bauss
New member
I'm trying to code a addon for Xenforo and the following code isn't working.
I get the error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\pokertalk\leaderstest.php on line 19
I'm using Wamp Server. Any idea how to fix it?
Code:
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("thepoker_db");
$query = mysql_query("SELECT user.username
, user.bcp_lbp
, user.bcp_freeroll_money_won
, profile.field_value AS poker_user
FROM xf_user
LEFT OUTER
JOIN xf_user_field_value AS profile
ON profile.user_id = user.user_id
AND profile.field_id = '626c61636b5f636869705f706f6b65725f757365726e616d65'
WHERE user.secondary_group_ids IN (2,4,5)");
$n = 0;
while($results = mysql_fetch_array($query))
{
$n++;
print "<table><tr><td>#." . $n++ . "</td>";
print "<td>" .$results['username'] . "</td>";
print "<td>" . $results['poker_user'] . "</td>";
print "<td align=\"center\">". $results['bcp_lbp'] ."</td>";
print "<td align=\"center\">$". $results['bcp_freeroll_money_won'] ."</td></tr></table>";
}
?>
I get the error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\pokertalk\leaderstest.php on line 19
I'm using Wamp Server. Any idea how to fix it?