Help me add qusetion from a datase into an array

Closed
trendsetterwallace
Posts
1
Registration date
Friday January 25, 2013
Status
Member
Last seen
January 25, 2013
- Jan 25, 2013 at 04:03 AM
Hello guys out there .i have been trying to get a list of qustions and answers that are in the database.so i thought putting them in array would work so i had this piece of code and its saying that undefined index


$ans = array();
$sql = "SELECT * FROM 'level 1' WHERE quiz_id = 1 LIMIT 0, 30 ";
$res = mysql_query($sql);
while($row= mysql_fetch_assoc($res))
{
$a=0;
$ans[] = $row[""];
$a++;
}
echo('<p>$ans[1]</p>');
echo('<form id="questions" name="questions" method="post" action="answers.php">
<label> Select your answer </label>
<p>
<label>
<input name="quiz" type="radio" value="ans1" />
$ans[3] </label>
</p>
<p>
<label>
<input name="quiz" type="radio" value="ans2" />
$ans[4] </label>
</p>
<p>
<label>
<input name="quiz" type="radio" value="ans3" />
$ans[5] </label>
</p>
<p>
<label>
<input name="quiz" type="radio" value="ans4" />
$ans[6]</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>