[PHP] Using info from a MySQL Query
I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using info from a MySQL Query
I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. echo $company ?? echo $email ?? Show what you have so far and what you want to happen. You're too vague. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using info from a MySQL Query
Put your variables into {} like this '{$_POST['email'] }', $sql =SELECT company, name, email FROM $table_name WHERE email = '{$_POST[email]}' AND password = password('{$_POST[password]}'); - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:09 PM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using info from a MySQL Query
I think you might want something like this: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); $rs = mysql_query ($sql, mysql_connect ('server', 'user', 'pass'); $a = mysql_fetch_array ($rs); echo $a['company']; echo $a['name']; Minus some error checking, this is pretty much it. Marco --- php|architect -- The Monthly Magazine For PHP Professionals Visit us on the web at http://www.phparch.com! On Tue, 5 Nov 2002, Ben C. wrote: I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using info from a MySQL Query
$sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); $result = mysql_query($sql) or die(Error: $sqlBR.mysql_error()); extract(mysql_fetch_row($result)); print $company $mail; rick People will forget what you said. People will forget what you did. But people will never forget how you made them feel. - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 7:09 PM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using info from a MySQL Query
$sql = query $result = mysql_query($sql) while ($data = mysqlfetch_array($result)) { echo $data['colum']; } - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 3:09 AM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using info from a MySQL Query
Sorry, I didn't read correctly the question- There are plenty way to do it for example : $query = mysql_query($sql) ; $ligne=mysql_fetch_array($query) ; echo $ligne['company'] ; echo $ligne['email'] ; or echo mysql_result($query,0,1); - Original Message - From: rija [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; Ben C. [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 1:34 PM Subject: Re: [PHP] Using info from a MySQL Query Put your variables into {} like this '{$_POST['email'] }', $sql =SELECT company, name, email FROM $table_name WHERE email = '{$_POST[email]}' AND password = password('{$_POST[password]}'); - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:09 PM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php