mysql_query() only returns a resource. Thus you need to use mysql_fetch_array() or mysql_fetch_assoc() to return an actual record. But in order to pull the NEXT record, you have to "fetch" the next row. In other words, in order to return multiple records, you have to move the record pointer.
For example, let's say you have the following Users table in your database:
name | last_login | total_logins
----------------------------------------
Frank | 2010-04-07 | 39
Bob | 2010-03-29 | 17
Jan | 2010-05-04 | 63
In order to display ALL of the records in the above recordset, this one way to do it:
// Get resource handle (recordset)...
$result = mysql_query("SELECT * FROM Users");
// Get each row of data...
while($row = mysql_fetch_assoc($result))
{
$data_str = implode(", ", $row);
echo $data_str."<br />";
}
This will produce the following output:
Frank, 2010-04-07, 39
Bob, 2010-03-29, 17
Jan, 2010-05-04, 63