I thought the IF statement was simple enough,
yet my code keeps slamming into an error
at the bottom of this php code
- and I don't know why.
I hope I'm not too embarrassed when I find out.
<?php
$conn = mysql_connect('localhost:8888', 'root', 'root');
if (!$conn) die('Could not connect: ' . mysql_error());
$db = mysql_select_db("Jokes", $conn);
if (!$db) die ('Can\'t use Jokes database : ' . mysql_error());
...
...
$showPicklist = "<select name= \"picklist\">";
if ($ResAllTables = mysql_query("SHOW TABLES")) {
while ($row = mysql_fetch_row($ResAllTables)) {
array_push($TablesArray, $row[0]);
$showPicklist .= "<option value=\"$row[0]\">$row[0]</option>";
}
$showPicklist .= "</select>";
}
?>
And, if I were to add an echo statement after the IF statement, it too gets flagged for an error.
P.S. This code is part of an INCLUDE file.
yet my code keeps slamming into an error
at the bottom of this php code
- and I don't know why.
I hope I'm not too embarrassed when I find out.
<?php
$conn = mysql_connect('localhost:8888', 'root', 'root');
if (!$conn) die('Could not connect: ' . mysql_error());
$db = mysql_select_db("Jokes", $conn);
if (!$db) die ('Can\'t use Jokes database : ' . mysql_error());
...
...
$showPicklist = "<select name= \"picklist\">";
if ($ResAllTables = mysql_query("SHOW TABLES")) {
while ($row = mysql_fetch_row($ResAllTables)) {
array_push($TablesArray, $row[0]);
$showPicklist .= "<option value=\"$row[0]\">$row[0]</option>";
}
$showPicklist .= "</select>";
}
?>
And, if I were to add an echo statement after the IF statement, it too gets flagged for an error.
P.S. This code is part of an INCLUDE file.