|
Posted by Ninja_Monkey on 02/28/06 13:57
thanks a lot. i understand how it works now.
"NC" <nc@iname.com> wrote in message
news:1141024957.853520.134370@t39g2000cwt.googlegroups.com...
> Ninja_Monkey wrote:
> >
> > Could you explain how this works for me though?
> >
> > while ($record = mysqli_fetch_array($result, MYSQLI_NUM)) {
> > echo $record[0], "<br>\r\n";
> > }
>
> When you pass a SELECT query to mysqli_query() function, it returns a
> pointer to a result set, conceptually similar to a file pointer
> returned by fopen(). In both cases, you need to use the pointer to
> read the data it points to, record by record (or, in case of a file,
> line by line). Each time you call mysqli_fetch_array(), it reads
> another record from the result set until it reaches the end of the
> result set. A record is returned as an array, whose structure
> replicates that requested by query. In your case, the query was SHOW
> DATABASES, and each record in a result set has only one field, which by
> definition gets number 0...
>
> Cheers,
> NC
>
[Back to original message]
|