mysql_fetch_array() Help needed

This is my problem:
PHP version 4.3.4
Mysql 4.0.18
Apache 1.3.24
System WinXP

I create a connection to my database(Mysql),then I create a sql query
to retrive the password associated to a username

$sqlcheck=“SELECT Password,pass FROM User WHERE Name = '”.$_POST[‘uname’]."’";


while ($info = mysql_fetch_array($risultato,MYSQL_BOTH)); {
printf ("%s
Password: %s,%s,%s
ris: %s
N: %d

This is the output :

"SELECT Password,pass FROM User WHERE Name = ‘aa’ "
(aa is a name that exist in the database)
"Password: "
“ris:Resource id #5

I don’t understand what I’m doing wrong.
(The sql query is ok , I tried it and it work with SQLyog)
(Almost forgotten the connection is ok , I used it to insert the data)

I think the problem is the mysql_fetch but I’ve tryed the other one
_row but it doesn’t work.

Can someone help me?


p.s. Sorry for my bad english , I hope you understand the meaning

Use print_r() or var_dump() on your $info array (which is a row). You will see all the values it contain and what they are associated with.

Sponsor our Newsletter | Privacy Policy | Terms of Service