Jump to content

[SOLVED] can someone help me with one line of php???? PLEASE


Recommended Posts

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thebestj/public_html/poker.php on line 1097

 

heres line 1097

 

return mysql_fetch_array(mysql_query("SELECT p.*, u.poker, u.money FROM poker p left join users u on (u.username='{$_SESSION['username']}') WHERE p.id=u.poker"));

 

 

whats wrong with it.

Add this in and see what it outputs:

 

   return mysql_fetch_array(mysql_query("SELECT p.*, u.poker, u.money FROM poker p left join users u on (u.username='{$_SESSION['username']}') WHERE p.id=u.poker") or die(mysql_error()));

Most likely the query fails. Change this one line into three

$sql = "SELECT p.*, u.poker, u.money FROM poker p left join users u on (u.username='{$_SESSION['username']}') WHERE p.id=u.poker";
$result = mysql_query($sql) or die(mysql_error()." $sql");
return mysql_fetch_array($result);

 

this should display what causes the error

Unknown column 'u.poker' in 'field list' SELECT p.*, u.poker, u.money FROM poker p left join users u on (u.username='Chris') WHERE p.id=u.poker

 

Thats The Problem. 

 

Has Anyone Got Msn Where I Can Have A Chat To And They Can Have A Good Look At The Script.?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.