php - Error with mysql_fetch_array() (CLOSED) -


i trying select multiple data rows database this:

$db = mysql_connect("example.example.com","username","password"); mysql_select_db("database", $db);  $data = mysql_query("select * users activated = 1", $db)     or die("problems database: ".mysql_error($db)); $row = mysql_fetch_array($data); 

but gives me error:

mysql_fetch_array() expects parameter 1 resource

although when var_dump($data); tells me resource(6) of type (mysql result).

i have tried various workarounds none of them have worked. tell me what's wrong?

thanks in advance.

please try fillowing code.

$data = mysql_query("select * users activated = 1")     or die("problems database: ".mysql_error($db)); $row = mysql_fetch_array($data); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -