Am new to PHP. I wanna dynamicly fill a drop-down menu from:
$table_name ="fromny";
$doweek ="monthu";
//this is part of an if statement, the values of $table_name & of $doweek will have changed depending on user input
$sql = "SELECT leaving AND $doweek FROM $table_name";
$result = @mysql_query($sql, $connection)or die(mysql_error());
$row = mysql_fetch_array($result);
$option_block .= "<option value=\"a\">$row[]</option>";
and the in the html flow later on in the page:
<select name="selectName" size="1">
<? echo "$option_block"; ?>
</select>
Where have I gone wrong?
$table_name ="fromny";
$doweek ="monthu";
//this is part of an if statement, the values of $table_name & of $doweek will have changed depending on user input
$sql = "SELECT leaving AND $doweek FROM $table_name";
$result = @mysql_query($sql, $connection)or die(mysql_error());
$row = mysql_fetch_array($result);
$option_block .= "<option value=\"a\">$row[]</option>";
and the in the html flow later on in the page:
<select name="selectName" size="1">
<? echo "$option_block"; ?>
</select>
Where have I gone wrong?