Re: mysql_fetch_array

From: Date: Sat, 10 Jun 2000 22:12:53 +0000
Subject: Re: mysql_fetch_array
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-308@lists.php.net to get a copy of this message
Sarhana, mysql_fetch_array() fetches a single row from a result set returned by a query. Subsquent calls to mysql_fetch_array() fetch additional rows until there aren't any more. The array returned by mysql_fetch_array is an array of the field contents for one record. It is stored in array that can be accessed either by field number or by field name. To load up an array to use to populate a drop down menu use something like: $sql = "select dropdownitem from table where conditions = 'met'"; $result = mysql_db_query($db,$sql,$ln) or exit ("error message"); while ($row = mysql_fetch_array($result) ){ $drop_down[$dropdownitem++] = $row["dropdownitem"]; } I hope this helps. Denny Bolton On Sat, 10 Jun 2000, sarahana wrote: > I looked up the PHP manual, but I could find out how to move to the next row > after doing select... > > Thanks. > > sarahana wrote: > > > I guess I have to move the cursor to the next file, right? duh. :-( > > > > sarahana wrote: > > > > > If I select a column from a table, and use mysql_fetch_array to store > > > the data into an array, what can I do so that each row of the column > > > gets stored as an element in the arrray? > > > > > > What I actually want to do is select a column and list them in a select > > > menu, and I'm using "do while" to list each row as an option in the > > > menu. It would help if I knew how the data gets stored in the array in > > > "mysql_fetch_array"... > > > > > > Thanks! > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net --

« previous php.db (#308) next »