Re: [PHP] a function for retuned vatiable

2006-10-02 Thread Richard Lynch
On Mon, October 2, 2006 7:08 am, Ross wrote: > 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=m

Re: [PHP] a function for retuned vatiable

2006-10-02 Thread David Tulloh
extract() - http://www.php.net/extract - does what you are after. However often it's easier to handle the array as you have a better idea of what variables are available, particularily if you are working with multiple tables. Ross wrote: > What I need is a quick way to assign variable names to th

RE: [PHP] a function for retuned vatiable

2006-10-02 Thread Peter Lauri
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($quer

Re: [PHP] a function for retuned vatiable

2006-10-02 Thread Jochem Maas
Ross wrote: > 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)) { >

[PHP] a function for retuned vatiable

2006-10-02 Thread Ross
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=