ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
Re: [PHP] $sring = ARRAY?
by Michael Lewis other posts by this author
Feb 29 2004 3:30PM messages near this date
[PHP] $sring = ARRAY? | 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" <axiom@[...].com> 
To: <php-general@[...].net> 
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
Thread:
Axiom
Michael Lewis
Burhan Khalid

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved