DiarYofaMadmaN
05-23-2004, 09:09 PM
$list_man = "SELECT Manufacturer FROM Manufacturers";
That is my query statment which is getting all the data from under the Manufacturer column from the Manufacturers table. I'm not totally sure on how to print out the results... I'm having all sorts of problems with the while loop
$list_man = "SELECT Manufacturer FROM Manufacturers";
function run_query($query) {
$Result = mysql_query ($query) or die(mysql_error());
if ($Result) {
echo "<select name='Category' id='Category'>";
while ($Row = mysql_fetch_array($Result)) { echo "<option>$Row['Manufacturer']</option>"; }
} else {
echo "The query could not be executed!";
}
mysql_close ($link);
print ("</select>");
}
I don't want to become a pest and keep asking simple question but I have no clue where to go to find out more indepth information on query statements and how to print out the results of them using PHP. I tried reading the mysql reference section on their site but I just get confused even more on how to convert the sql statement slightly to work in php because the syntax they are giving me is for the query statements to use in the mysql control manager.
That is my query statment which is getting all the data from under the Manufacturer column from the Manufacturers table. I'm not totally sure on how to print out the results... I'm having all sorts of problems with the while loop
$list_man = "SELECT Manufacturer FROM Manufacturers";
function run_query($query) {
$Result = mysql_query ($query) or die(mysql_error());
if ($Result) {
echo "<select name='Category' id='Category'>";
while ($Row = mysql_fetch_array($Result)) { echo "<option>$Row['Manufacturer']</option>"; }
} else {
echo "The query could not be executed!";
}
mysql_close ($link);
print ("</select>");
}
I don't want to become a pest and keep asking simple question but I have no clue where to go to find out more indepth information on query statements and how to print out the results of them using PHP. I tried reading the mysql reference section on their site but I just get confused even more on how to convert the sql statement slightly to work in php because the syntax they are giving me is for the query statements to use in the mysql control manager.