greenbman Posted February 12, 2013 Share Posted February 12, 2013 Ok Here is the query: $q = "INSERT INTO `reff` SET 'firstName' = '{$fname}', 'hear' = '{$ham}', 'message' = '{$message}';"; You have an error in your [url="http://brianflores.capnix.com/reference.php#"]SQL syntax[/url]; check the manual that corresponds to your MySQL server version for the right syntax to use near ''firstName' = 'Brian', 'hear' = 'A very good friend', 'message' = 'This guys is ' at line 1[img=http://aa.static.facdn.com/v/img/1x1.gif][img=http://itxt.couponamazing.com/hks?p=YTE5Mjc4MjEzNDMa6b7v3%2BLEp4s6FVfyskw0iVDTmqQSXmPAEC8Hw43ge8fe5NagbigAIYsDISQSP0H0BQRGbXWUL2PKkZLqiLVV6dPwxy5STlOx34PA25H8NeGqTxCZEdhU%2ByioyrZdEFPk1719cRk2AA1R846Kl2%2B9&cks=YTQyMjE1MDgzOTPXBuoFUIKsUIPnglqbzUOkqLjrr4I3GQE%2BG%2B2FdQoF4A36DN8UaieULOFlK174dLl413sY%2F8Ez3Q%3D%3D&t=1][img=http://itxt.couponamazing.com/acttr?v=1&a=te_trck_old%3A%091%09FP15&t=1360627629078][img=http://itxt.couponamazing.com/acttr?v=1&a=te_trck_new%3A%092%090%09FP15&t=1360627629079] Quote Link to comment https://forums.phpfreaks.com/topic/274369-query-problem/ Share on other sites More sharing options...
Jessica Posted February 12, 2013 Share Posted February 12, 2013 You shouldn't put quotes around your column names. Quote Link to comment https://forums.phpfreaks.com/topic/274369-query-problem/#findComment-1411868 Share on other sites More sharing options...
greenbman Posted February 12, 2013 Author Share Posted February 12, 2013 why not? I have been doing that for quite some time and never had a problem untill now. Quote Link to comment https://forums.phpfreaks.com/topic/274369-query-problem/#findComment-1411870 Share on other sites More sharing options...
greenbman Posted February 12, 2013 Author Share Posted February 12, 2013 Wow I took them out and it worked! You are awesome my friend! Quote Link to comment https://forums.phpfreaks.com/topic/274369-query-problem/#findComment-1411871 Share on other sites More sharing options...
Jessica Posted February 12, 2013 Share Posted February 12, 2013 Because in SQL column names should not be strings. I doubt you have been doing that and had it work. Quote Link to comment https://forums.phpfreaks.com/topic/274369-query-problem/#findComment-1411877 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.