for some reason I’m having trouble getting output with this form.. I have a horrible feeling it’s a stupid reason I’m missing, but I’ve been staring at this for hours trying to figure out why..
$pnames = $mysql_db->query('SELECT * FROM patient ORDER BY name ASC'); //normal query
<form action="<?php $_SERVER['PHP_SELF']?>?action=addLog" method="POST">
<select name="pname">
<?
while ($p = mysql_fetch_object($pnames)) {
echo "<option value=".$p->pid.">".$p->name."</option>";
}
?>
</select>
<input type="submit"
value="Add Log" />
</form>
Could somebody please help me figure out why the select has no options? (I’ve literally checked it against previous code that worked, which is baffling me. I’m starting to think it’s a query problem.. anyways. Thanks in advance
you need to close this one
like so
and make sure your
PHPsupports short tag because you use it.try this instead