DiarYofaMadmaN
05-25-2004, 02:27 AM
<?PHP
include 'dbconnect-include.php';
$TableName = maxforcepc;
$link = mysql_connect ($Host, $User, $Password);
mysql_select_db($DBName, $link);
$id_query = "SELECT ID FROM products";
$list_query = "SELECT $col FROM $table";
$id_result = mysql_query ($query) or die(mysql_error());
function results($results) {
$list_results = mysql_query ($results);
}
function run_query($col, $table) {
if ($list_results) {
echo "<select name='$col' id='$col'><option></option>";
while ($Row = mysql_fetch_array(results($list_query)) { echo "<option>".$Row[$col]."</option>"; }
} else {
echo "The query could not be executed!";
}
mysql_close ($link);
print ("</select>");
}
?>
I'm getting syntax errors and i think it has to do with this line: while ($Row = mysql_fetch_array(results($list_query)) I'm not really sure on how to use a function with doing that... Can any one help me out?
-peace
include 'dbconnect-include.php';
$TableName = maxforcepc;
$link = mysql_connect ($Host, $User, $Password);
mysql_select_db($DBName, $link);
$id_query = "SELECT ID FROM products";
$list_query = "SELECT $col FROM $table";
$id_result = mysql_query ($query) or die(mysql_error());
function results($results) {
$list_results = mysql_query ($results);
}
function run_query($col, $table) {
if ($list_results) {
echo "<select name='$col' id='$col'><option></option>";
while ($Row = mysql_fetch_array(results($list_query)) { echo "<option>".$Row[$col]."</option>"; }
} else {
echo "The query could not be executed!";
}
mysql_close ($link);
print ("</select>");
}
?>
I'm getting syntax errors and i think it has to do with this line: while ($Row = mysql_fetch_array(results($list_query)) I'm not really sure on how to use a function with doing that... Can any one help me out?
-peace