I am trying to select multiple data rows from the database like this:
$db = mysql_connect("example.example.com","username","password");
mysql_select_db("database", $db);
$data = mysql_query("SELECT * FROM users WHERE activated = 1", $db)
or die("Problems with database: ".mysql_error($db));
$row = mysql_fetch_array($data);
but it gives me this error:
mysql_fetch_array() expects parameter 1 to be resource
although when I do var_dump($data); it tells me that it is resource(6) of type (mysql result).
I have tried various workarounds but none of them have worked. Could anyone tell me what's wrong?
Thanks in advance.