darkfreaks Posted March 3, 2010 Share Posted March 3, 2010 what would cause $this->messages to break when inserted into the database when i insert don't i get "error inserting don't into the database" Note i have used dots to escape the insert Link to comment https://forums.phpfreaks.com/topic/194060-insert-help/ Share on other sites More sharing options...
darkfreaks Posted March 3, 2010 Author Share Posted March 3, 2010 wont' insert single quotes: $insert_message = mysql_query(" insert into chat_messages (user, type, content, pm_user, location) values ( '$poster', '$type', '".$this->message."', '$pm_user', '$location' ) "); Link to comment https://forums.phpfreaks.com/topic/194060-insert-help/#findComment-1021112 Share on other sites More sharing options...
darkfreaks Posted March 3, 2010 Author Share Posted March 3, 2010 fixed i used: $this->message = str_replace("'","''",$message); Link to comment https://forums.phpfreaks.com/topic/194060-insert-help/#findComment-1021117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.