DaveLinger Posted June 29, 2007 Author Share Posted June 29, 2007 NOW we're getting somewhere. It's now correctly knowing it needs to ADD, not UPDATE. 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 ''rid', 'uid', 'rating') values ('4', '1', '5')' at line 2 query = INSERT INTO ratings ('rid', 'uid', 'rating') values ('4', '1', '5') Link to comment https://forums.phpfreaks.com/topic/57567-solved-code-returning-false-mysql-result/page/2/#findComment-285411 Share on other sites More sharing options...
DaveLinger Posted June 29, 2007 Author Share Posted June 29, 2007 This is very close to working. If I manually add a row with values: rid=4, uid=1, rating=2, it DOES say "Rating Updated Successfully", and it DOES update it. Link to comment https://forums.phpfreaks.com/topic/57567-solved-code-returning-false-mysql-result/page/2/#findComment-285421 Share on other sites More sharing options...
corbin Posted June 29, 2007 Share Posted June 29, 2007 INSERT INTO ratings ('rid', 'uid', 'rating') values ('4', '1', '5') For column names you use backticks (`s), and for values you use single quotes ('s). Try INSERT INTO ratings (`rid`, `uid`, `rating`) values ('4', '1', '5'). Actually, with this query, I don't think you need any of the backticks since the column names aren't reserved words, but I like to use them anyway ;p. Link to comment https://forums.phpfreaks.com/topic/57567-solved-code-returning-false-mysql-result/page/2/#findComment-285425 Share on other sites More sharing options...
DaveLinger Posted June 29, 2007 Author Share Posted June 29, 2007 INSERT INTO ratings ('rid', 'uid', 'rating') values ('4', '1', '5') For column names you use backticks (`s), and for values you use single quotes ('s). Try INSERT INTO ratings (`rid`, `uid`, `rating`) values ('4', '1', '5'). Actually, with this query, I don't think you need any of the backticks since the column names aren't reserved words, but I like to use them anyway ;p. Yeah that did it thanks! Thanks to Thorpe, too, he actually said that a few posts back but I misunderstood and made all of the values in quotes, even column names. Link to comment https://forums.phpfreaks.com/topic/57567-solved-code-returning-false-mysql-result/page/2/#findComment-285426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.