$query = "SELECT * FROM table WHERE data = '$userinput'";
$row = mysql_query($query);
while ($row = mysql_fetch_array($row))
{
echo $row['data'];
}
Ok So my questions are:
- What exactly does mysql_fetch_array return?
- AND if my WHERE clause finds multiple matches, shouldn’t the loop execute numerous times?
I am running a program and I can only get the first result to print
You’re overwriting
$row. Instead use a different variable for the query result.