noclist Posted November 17, 2010 Share Posted November 17, 2010 Would someone be able to tell me why I can't run a successful mysql_query($sql) with $sql="INSERT INTO myDB.Titles (Title, Year, cID) values('". $title . "', '" . $year . "', '" . $cID . "')"; $sql echoes out to "INSERT INTO myDB.Titles (Title, Year, cID) values('Test', '2000', '2')" It looks right but I'm probably off on the quotes somewhere. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/219002-sql-insert-help/ Share on other sites More sharing options...
Psycho Posted November 17, 2010 Share Posted November 17, 2010 Impossible for us to day. Why don't you ask the SQL server what the problem is? mysql_query($sql) or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/219002-sql-insert-help/#findComment-1135755 Share on other sites More sharing options...
sKunKbad Posted November 17, 2010 Share Posted November 17, 2010 INSERT INTO `myDB.titles` (`Title`, `Year`, `cID`) VALUES ('Test', '2000', '2'); You could also try running the insert straight from phpMyAdmin and see what errors it spits out at ya. Quote Link to comment https://forums.phpfreaks.com/topic/219002-sql-insert-help/#findComment-1135760 Share on other sites More sharing options...
noclist Posted November 17, 2010 Author Share Posted November 17, 2010 Thanks for the advice, I got it worked out. Quote Link to comment https://forums.phpfreaks.com/topic/219002-sql-insert-help/#findComment-1135838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.