pthurmond Posted November 27, 2006 Share Posted November 27, 2006 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 1This 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 More sharing options...
AndyB Posted November 27, 2006 Share Posted November 27, 2006 I suspect that [b]$[/b]a.Activity_ID in the query should be a.Activity_ID Link to comment https://forums.phpfreaks.com/topic/28586-strange-query-error/#findComment-130795 Share on other sites More sharing options...
pthurmond Posted November 27, 2006 Author Share Posted November 27, 2006 Thanks, sorry about that everyone, I have been at this waaayy too long today! Link to comment https://forums.phpfreaks.com/topic/28586-strange-query-error/#findComment-130797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.