PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// Get list of authors for the sort menu
$authors_qry = "SELECT author FROM megasquirt";
$result=mysql_query($authors_qry);
$num=mysql_numrows($result);
if ($num==0)
{
$authors = "<option> --- </option>";
}
else
{
$count=0;
while ($count < $num)
{
$authors .= "<option name='sort' value='" . mysql_result($result,$count,"author") ."'>". mysql_result($result,$count,"author") . "</option>";
$count++;
}
}
In the table 'megasquirt', there are currently 3 rows. Row 1 has an author of 'tristanlee85' and rows 2 and 3 have an author of 'Natedogg'. This script creates a drop-down menu with the "author" as an option. The problem is, this returns both options to select Natedogg as the author in my drop-down menu. I tried using isset() with no luck. Any suggestions?
Last edited by tristanlee85 on Thu Sep 28, 2006 12:59 am, edited 1 time in total.
Yeh. A lot of the Saturn guys are turning to the MegaSquirt because they are cheap. Most of the people on my site run with the MS and by sharing each other's configurations, it helps to give a nice starting point for others who are new to the system.