Warning: expects resource but string given

Posted by Damien on Stack Overflow See other posts from Stack Overflow or by Damien
Published on 2010-03-20T12:00:03Z Indexed on 2010/03/20 12:11 UTC
Read the original article Hit count: 263

Filed under:
|

I get: "Resource id #8 Warning: mysql_fetch_array() expects parameter 1 to be resource, string given"

Heres the code:

$sql="SELECT password FROM user WHERE userid=$userid";    
echo $password=mysql_query($sql);

while($row = mysql_fetch_array($password)) {
    $password = $row['password'];
}   

Any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about error