Re: note 9517 added to mysql_query

From: Date: Wed, 08 Nov 2000 18:52:54 +0000
Subject: Re: note 9517 added to mysql_query
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-7503@lists.php.net to get a copy of this message
bwilson@netpcs.com writes: > I have a real beginner's question. How do I get the string result from a SELECT statement > into a variable? > EX: SELECT email_address FROM users WHERE name = "bob"; > > I want the email address stored in a variable called $email_Address. > > http://www.php.net/manual/function.mysql-query.php if ($res = mysql_db_query($db, $query, $dbh)) { $email_address = mysql_result($res, 0, 'email_address'); } http://www.php.net/manual/function.mysql-result.php http://www.php.net/manual/function.mysql-fetch-array.php http://www.php.net/manual/function.mysql-fetch-row.php http://www.php.net/manual/function.mysql-fetch-object.php Hope this helps, Torben -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.notes (#7503) next »