Re: [PHP] $sring = ARRAY?
MYSQL_FETCH_ROW returns an array of the values of the columns in a row. When you try to use that value as, for example, a string or in a print statement you get the word Array. What you probably want to do is the following (not knowing your actual column names): if (($value = mysql_fetch_array($result)) AND ($value['username'] == $username)) { echo You are authenticated; } else { echo Your username or password is incorrect; } - Original Message - From: Axiom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 28, 2004 11:57 PM Subject: [PHP] $sring = ARRAY? Why is it that in the following code that $value comes back with just the word ARRAY instead of the actual result? if (($value = mysql_fetch_row($result)) AND ($value == $username)) { echo You are authenticated; } else { echo Your username or password is incorrect; } -Casey --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.598 / Virus Database: 380 - Release Date: 2/28/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $sring = ARRAY?
Why is it that in the following code that $value comes back with just the word ARRAY instead of the actual result? if (($value = mysql_fetch_row($result)) AND ($value == $username)) { echo You are authenticated; } else { echo Your username or password is incorrect; } -Casey --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.598 / Virus Database: 380 - Release Date: 2/28/2004
Re: [PHP] $sring = ARRAY?
Axiom wrote: Why is it that in the following code that $value comes back with just the word ARRAY instead of the actual result? if (($value = mysql_fetch_row($result)) AND ($value == $username)) { echo You are authenticated; } else { echo Your username or password is incorrect; } Read http://www.php.net/mysql-fetch-row -- especially the part where it talks about what the function returns. Hint -- its at the very top of the page. Another hint -- the function returns whatever it is you typed in ALL CAPS in your email. And the final hint -- the answer to your subject is, no -- you cannot do that. In short, read the manual. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php