Jump to content

INNER JOIN error


master82

Recommended Posts

Here is the code I am attempting to use, I have checked all the tables names, fieldnames and have even looked to see if they contained data...

<?php
$ud=mysql_query("SELECT `users`.`usersNAME`, `worth`.`worthMONEY 
FROM `users` 
WHERE `users`.`usersID` = '{$userid}' 
INNER JOIN `worth` ON `users`.`usersID` = `worth`.`worthID`") or die(mysql_error());

$u=mysql_fetch_assoc($ud);
?>

 

However, I get the following output:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' AS `users` WHERE `users`.`usersID` = '1' INNER JOIN `worth` ON `users`.`usersID' at line 1

 

Any ideas as to where im going wrong?

Link to comment
https://forums.phpfreaks.com/topic/56420-inner-join-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.