php - DropDown Menu echo error -
i attempting create drop-down menu within booking system lists events sql
database,
this code have written:
$sql = "select * events"; $exesql = mysql_query($sql); while($arrayevents = mysql_fetch_array($exesql)); { echo"<li><a href=$arrayevents['eventname']</a></li>"; }
as new php wondering how can improve , prevent error:
parse error: syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string in /home/unix/student10/w1284519/public_html/stf/dropdown.php on line 26
line 26
echo written
edit: error has been fixed code displays 3 bulletpoints, how fix this?
thank in advance help!
echo"<li><a href=$arrayevents['eventname']</a></li>";
is list
not dropdown
, change this:
echo "<select>"; while($arrayevents = mysql_fetch_array($exesql)) { echo"<option> $arrayevents['eventname']</option>"; } echo "</select>";
Comments
Post a Comment