NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mysql query result for php

Ovidiu nonreal at nonreal.ro
Wed Mar 31 06:21:39 EST 2004


Solved my problem:
  $results=array();
   while ($row = mysql_fetch_array($firme)) {
    array_push ($results, $row['ClientClassName']);
  }
print_r ($results) will display something similar to Array ( [0] => text1 [1] => text2 [2] => test3 ) 
*********** REPLY SEPARATOR ***********

On 3/31/2004 at 6:13 AM jon baer wrote:
if you just need the values of the array for your class use array_values() like:

$names = array_values($text_array);

http://us2.php.net/manual/en/function.array-values.php

hth,

- jon
----- Original Message ----- 
From: Ovidiu 
To: talk at lists.nyphp.org 
Sent: Wednesday, March 31, 2004 3:57 AM
Subject: [nycphp-talk] Mysql query result for php


Hello.
I'm using a graph class to generate stats. This class requires one var named $names witch must be $names=("name1","name2","name3",...) ( from class example).
I need to construct some graph with data retrieved from a mysql database.
Any ideea how to output a mysql query result into that format ?

When I print_r $names i see something like that : Array ( [0] => text1 [1] => text2 [2] => test3 ) 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040331/98a77fd5/attachment.html>


More information about the talk mailing list