I seem to be struggling to get this section of the script to work. basically it dies with error, 'no database selected'. What i don't understand is that as far as i can see everything is OK. I have copied it from another script which works fine!
Any ideas, have i missed something really obvious?
Cheers
Jamie
<?
/ setup queries to populate the select boxes /
$dbhost = 'localhost';
$dbuser = 'jesus_hairdo';
$dbpassword = 'xxxxxx';
$dbname = 'consultants';
$conn = mysql_connect( $dbhost, $dbuser, $dbpass );
mysql_select_db( $dbname );
$sql_groups = "SELECT FROM groups";
$sql_types = "SELECT FROM types";
$groups_result = mysql_query( $sql_groups ) or die ( mysql_error() );
$types_result = mysql_query( $sql_types ) or die ( mysql_error() );
/* draw groups select boxes */
while ($groups_row = mysql_fetch_row( $groups_result))
{
print "<option value=\"$groups_row[0]\">$groups_row[1]</option>";
}
?>
</select>
</td>
<td>
<select name="consultant_type" style="background-color: #BCFAFA; border: 2 solid #000000">
<option>Any</option>
<?
/* draw types select boxes */
while ($types_row = mysql_fetch_row($types_result))
{
print "<option value=\"$types_row[0]\">$types_row[1]</option>";
}
mysql_close($conn);
}?>