dewey_witt Posted April 9, 2009 Share Posted April 9, 2009 <?php $sql ="UPDATE user_pro SET real_name='$real_name', location='$loc', signature='$sig' WHERE user_name=$user_name"; ?> I keep getting the error "Check you syntax to use near " in line 1" =/ boggling. I've done this 092387502983475029347 times.... never had this issue. Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/ Share on other sites More sharing options...
wildteen88 Posted April 9, 2009 Share Posted April 9, 2009 String value should always be wrapped within quotes. $sql ="UPDATE user_pro SET real_name='$real_name', location='$loc', signature='$sig' WHERE user_name='$user_name'"; Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805406 Share on other sites More sharing options...
dewey_witt Posted April 9, 2009 Author Share Posted April 9, 2009 ok... wrapped it with quotes as I should have to begin with yet still the same drab error message telling me that I've included a " <-- quotation mark near line 1 that is throwing the query syntax off. Still boggled. <?php $sql ="UPDATE user_pro SET real_name='$real_name', location='$loc', signature='$sig' WHERE user_name='$user_name'"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805412 Share on other sites More sharing options...
wildteen88 Posted April 9, 2009 Share Posted April 9, 2009 What does the query look like when you echo it before running mysql_query. Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805414 Share on other sites More sharing options...
dewey_witt Posted April 9, 2009 Author Share Posted April 9, 2009 UPDATE user_pro SET real_name='$real_name', location='$loc', signature='$sig' WHERE user_name='$user_name' lol Like this. Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805417 Share on other sites More sharing options...
wildteen88 Posted April 9, 2009 Share Posted April 9, 2009 No I meant echo the $sql variable. That way we know how your query is being constructed once the variables witihn your query have been parsed. echo $sql; Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805423 Share on other sites More sharing options...
dewey_witt Posted April 9, 2009 Author Share Posted April 9, 2009 After commenting out all the connection includes etc. accept for the post data handeling.... the result of echo = UPDATE user_pro SET real_name='loki', location='Crazyville', signature='~Ness' WHERE user_name='Arra The Wise' So it is parsing.... maybe its my hosting. I've never had this issue before even with a simple query like this. Quote Link to comment https://forums.phpfreaks.com/topic/153308-anyone-see-whats-wrong-with-this-i-cant/#findComment-805437 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.