Jump to content

code not working


snowdog

Recommended Posts

I haven't coded in about a year and am a little rusty. Here is the code. I have turned error reporting on but for some reason it is not working on my server.

	<?php
						// Load The dealers in for the franchisee

						include("include/db_connect.php");

						SESSION_START();
						$franchise_id = $_SESSION['franchise_id'];

						// Query the database and get dealers

						$SQL = "SELECT * FROM dealers WHERE franchise_id = '$franchise_id' ORDER BY name ASC";
						$result = mysql_fetch_array($SQL) or die(mysql_error());
						while($run = mysql_fetch_array($result))
						{
							?><option value="<? echo $run['id']; ?>"><? echo $run["name"]; ?></option>
						<?

						}

						?>

Link to comment
Share on other sites

Please be specific by what is meant by "Not working". Are you getting ANY output. If so, how does that output differ from your expectations? Did you look at the HTML source code in your browser to see what is in there that isn't directly displayed in the page?

 

If you are not getting any errors it could be:

 

1. The server does not have PHP installed so the file is sent as a plain HTML file and the PHP code will not be displayed in the browser because the PHP tags are treated like HTML tags.

2. The query is not returning any results

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.