RE: [PHP] a function for retuned vatiable

From: Date: Mon, 02 Oct 2006 12:12:20 +0000
Subject: RE: [PHP] a function for retuned vatiable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-242464@lists.php.net to get a copy of this message
Not actually sure what you want, but this might do it :) $j = 0; While($Row = mysql_fetch_array($Result)) { $email[$j] = $Row['email']; ... ... $j++; } -----Original Message----- From: Ross [mailto:ross@aztechost.com] Sent: Monday, October 02, 2006 7:09 PM To: php-general@lists.php.net Subject: [PHP] a function for retuned vatiable What I need is a quick way to assign variable names to the same value of the row name. example.. $query= "SELECT * from $table_name WHERE sname=='hulford'"; $result = mysql_query($query) or die('Error, query failed'); while ($row=mysql_fetch_array($result)) { $email = $row['email']; $name=$row['name']; $address = $row['address']; //this goes on for 30 fields is there a way to automate this? } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#242464) next »