No offense to the writer, the concept looks good and there are 50,000 views, but the example is very hard to understand. The writer says it all works as one file, but then says "you can replace with" and then finally says "try this first" for just the bottom snippet of code.
I copied and pasted the code, and I am getting the following error
It is being caused by the following code, line 26 being
if (!mysql_query("SELECT * FROM table WHERE ID=$P"))
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
$selected = mysql_select_db("first_test",$dbh)
if (!mysql_query("SELECT * FROM table WHERE ID=$P"))
{
echo "Database is down";
}
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
$NewData .= "<option value='".$row['ID']."'>".$row['Name']."</option>\n";
}
mysql_close($dbh);
Any ideas?