Reply to Re: How can i display a list of mysql databases in php?

Your name:

Reply:


Posted by NC on 02/27/06 09:22

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация