Jump to content

Strange Query error!


pthurmond

Recommended Posts

Ok I keep getting the following error and I am having trouble understanding why...

Query failed: 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 '= .Activity_ID AND al.Event_Log_ID = '34'' at line 1

This comes from the following query:
[code]
$query = "SELECT a.Name FROM Activities AS a, Activity_List AS al WHERE $a.Activity_ID = $al.Activity_ID AND al.Event_Log_ID = '$logid' ";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
[/code]

I have checked and rechecked, all of the table and field names are spelled and even capitalized correctly. Also the Event_Log_ID number does exist in the table that I am referring to. I have used joins before on other scripts in this same project in the same way and I am having no problems with it.

Thanks,
Patrick
Link to comment
https://forums.phpfreaks.com/topic/28586-strange-query-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.