Re: echo
| From: | mike cullerton | Date: | Fri, 03 Aug 2001 17:50:56 +0000 |
| Subject: | Re: echo | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61162@lists.php.net to get a copy of this message | ||
on 8/3/01 11:30 AM, Jeremy Morano at jeremy@prepresshelp.com wrote:
> $sql = "SELECT first_name, last_name, address, state, zip_code, country,
> company, occupation, telephone, fax, email, entry_name, password, package,
> registration_date, valid_until, max_users
> FROM $table_name
> WHERE uid = \"$uid\"
> ";
>
>
> $result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
>
> ----------------------------------------------------------------------------
> -------------------------------------------
> -----------When I echo $sql, I get this result
> -----------SELECT first_name, last_name .......
> How can I echo the actual values?
>
you have to loop through the results and then echo them.
while ($row = mysql_fetch_row($result)) {
do_soemthing();
}
note that $row is an array
http://www.php.net/mysql
http://www.php.net/mysql_fetch_row
-- mike cullerton