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
https://forums.phpfreaks.com/topic/255837-code-not-working/
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
https://forums.phpfreaks.com/topic/255837-code-not-working/#findComment-1311480
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.