hi
The result is 1 handle.
This handle is like an array.
One array is ONE = 1
But you can make a loop to get each row from this result.
You should look into PHP Manual mysql functions:
http://docs.php.net/manual/en/ref.mysql.php
Bottomline:
Most php QUERY functions to databases Returns a handle, a resource they call it.
this is 1 resource, a container,
which usually can hold 0, 1, 2 or more rows.
What you call $result .. is one result.
But can have any number of elements, rows, inside.
Compare with one (1) google search:
- you get one(1) your result
- this result can have 0 - xxx number of google hits
- usually this ONE SEARCH result has got like 143.475 hits
from which you are first presented 10 of them.
then you press button NEXT, to see next 10 hits .. etc etc
Same in this standard example from PHP Manual.
A while loop is used to fetch, if there is at least 1 row,
and
then until is no more row to fetch ..... [man]mysql_query[/man]
//
// Perform Query
$result = mysql_query($query);
// Get result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used:
// mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc....
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}
//
Regards 🙂
halojoy