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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -