c-o-d-e Posted December 12, 2009 Share Posted December 12, 2009 I recieve this notice/error. Notice: 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 'By, Tutname, Tutorial, Description, Category, Subcategory, Date, IP) VALUES ('Ad' at line 1 in /home/jeanie/public_html/tutorials.php on line 173 Line 173 is... $query = mysql_query("INSERT INTO Tutorials (By, Tutname, Tutorial, Description, Category, Subcategory, Date, IP) VALUES ('$by','$tutname','$tutorial','$description','$category','$subcategory','$date','$ip')") or trigger_error("Query failed: " . mysql_error()); It gets to VALUES ('Ad' I assume Ad, is the start of my username. $by is defined as the logged in users usename. My username is Admin. Whats the problem? thanks. Link to comment https://forums.phpfreaks.com/topic/184834-mysql-query-failure-notice/ Share on other sites More sharing options...
rajivgonsalves Posted December 12, 2009 Share Posted December 12, 2009 by is a reserved keyword either change the filename or enclose in backticks Link to comment https://forums.phpfreaks.com/topic/184834-mysql-query-failure-notice/#findComment-975731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.