I know this is fairly common, but I'm having a problem getting the listbox to populate;
Here is the code I'm using
Database connection php
Code: Select all
<?php
$dbServer="localhost";
$username="username";
$password="password";
$database="database";
//make database connection
$conn = mysql_connect($dbServer,$username,$password);
@mysql_select_db("$database") or die("unable to select database".mysql_error());
?>Code: Select all
<label>Resource Required
<select name="Resource">
<option value=>--Select--</option>
<?
//get records from database(table resource)
$list=mysql_query("SELECT * FROM Resource");
//show records by while loop
while($row_list=mysql_fetch_array($list))
?>
<optionvalue="<? echo $row_list[Res_ID]; ?>" </option>
</select>