can anyone tell me what's wrong with the following code?
Trying to get php to grab the posible values of group and make a nice <select>.
Thing is I use (almost) the same code, on a different table in the same db and it works like a charm.
Code:
<?php
//connect to db
$conn = mysql_connect("localhost", "dbusr", "somepassword") or die("Invalid server or user");
//select db
mysql_select_db("roombook", $conn);
$result=mysql_query("SELECT DISTINCT group FROM links", $conn);
while ($myrow=mysql_fetch_array($result)) {
* * *echo"<option value=\"".$myrow["group"]."\">".$myrow["group"]."</option>\n";
* * *}
?>
I get this error:
supplied argument is not a valid MySQL result resource
It craps out at the "while". I did a search for it but all I can find is sites who have this error in thier code.
If I change the query to another field same table it works.
Is the name "group" a restricted name or something?
Bookmarks