glish_dreams
08-20-2007, 05:39 AM
<?php
mysql_connect(localhost,$user_db,$pass_db);
@mysql_select_db($database) or die( "Unable to select database");
$query=" SELECT * FROM ca_spots WHERE zone='CA1'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while($i<$num) {
$zone=mysql_result($result,$i,"zone");
$spot_name=mysql_result($result,$i,"spot_name");
echo "<option value=\"$spot_name\">$spot_name</option>";
$i++;
}
?>
Iv list that same code in alot of places and im just wondering if theres a way easyer way to make a Dropbox fill with my mySQL database content
mysql_connect(localhost,$user_db,$pass_db);
@mysql_select_db($database) or die( "Unable to select database");
$query=" SELECT * FROM ca_spots WHERE zone='CA1'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while($i<$num) {
$zone=mysql_result($result,$i,"zone");
$spot_name=mysql_result($result,$i,"spot_name");
echo "<option value=\"$spot_name\">$spot_name</option>";
$i++;
}
?>
Iv list that same code in alot of places and im just wondering if theres a way easyer way to make a Dropbox fill with my mySQL database content