Re: Arrays...
| From: | jimtronic | Date: | Wed, 12 Dec 2001 15:01:18 +0000 |
| Subject: | Re: Arrays... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77446@lists.php.net to get a copy of this message | ||
http://php.net/array
Try $data = mysql_fetch_assoc($series)
This will produce an associative array with column names attached to values for one row
of data from your database.
jim
Hi, im trying to fill a chart with some data. I am using a mysql query: $query = "SELECT serie_tot, COUNT(*) FROM statistik WHERE shooter='mindbash' GROUP BY serie_tot"; $series = mysql_query($query) It returns the results i want, ie value - count value2 - count etc... Now - i am trying to get this data into an array and is using: $data = mysql_fetch_array($series); But that doesn´t work! If i do it manually: $data = array( "value" => 4, "value2" => 2); ...it works like a charm. What´s the difference between these arrays? I would also, very much, appreciate a tip on where i could learn how to master arrays. I am tearing my hair out here. Regards-- Jim Musil --------- Multimedia Programmer Nettmedia ------------- 212-629-0004 jim@nettmedia.com# Daniel Alsén | www.mindbash.com ## d@mindbash.com | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net