Forum Moderators: coopster
I am using the following code
<?php
include '/home/www/juttuffi/dbc.php';
$query1 = mysql_query("SELECT * FROM tquestions ORDER BY qid ASC");
if (mysql_num_rows == 0)
{
echo "There is nothing in the database";
}
else
{
echo '<form method="post" action="answeradd.php">';
echo '<select name="quest">';
while ($qrow = mysql_fetch_array($query1,MYSQL_ASSOC))
{
echo "<option>".$qrow['question']."</option>";
}
echo '</select>';
echo '</form>';
}
mysql_close($dbc);
?>
I know there is stuff in the database I can see it using phpmyadmin and when i perform the query SELECT * FROM tquestions ORDER BY qid ASC I get the result I want in phpmyadmin but when I do it using the above code I get There is nothing in the database
Can anyone help me out here and tell me if and possibly where I am going wrong here?
[edited by: bysonary at 6:35 pm (utc) on Feb. 11, 2007]