Re: SQL values -> variables...
| From: | Cynic | Date: | Thu, 04 Jan 2001 17:07:53 +0000 |
| Subject: | Re: SQL values -> variables... | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4810@lists.php.net to get a copy of this message | ||
$query = "SELECT web_e.email FROM web_email web_e, users u WHERE u.user_id =
'tomasz'";
$result = mysql_query( $query )
or die( "query error: email." );
$email = array() ;
while ( $row = mysql_fetch_array( $result ) ) {
$email[] = $row[0];
}
$email will be an array of user's email addresses, which might
be anything from 0 addresses to ... many.
At 17:59 4.1. 2001, Tomasz Abramowicz wrote the following:
--------------------------------------------------------------
>hi.
>little problem.
>
>i have a script which pulls out info about users,
>which 'possibly' have multiple email addresses.
>I have written this to pull out the information,
>but how do i create variables 'on the fly' to contain
>the emails which might or might not be there?
>
><?
>
>$query = "SELECT web_e.email FROM web_email web_e, users u WHERE u.user_id =
>'tomasz'";
>$result = mysql_query( $query )
> or die( "query error: email." );
>
>while ( $row = mysql_fetch_array( $result ) ) {
>
> $email = $row[0];
>
>}
>
>?>
>
>tnx,
>Tomasz Abramowicz
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz