mysql - Trouble handlign apostrophes in php form -


i graphic designer church website. don't have great deal of programming knowledge, enough come here , ask. church in between programmers , have issue prayer request form. when enters request contains apostrophe, says it's unable submit (looking @ code, it's supposed tell them when can't update db). code:

$conn = mysql_connect('database connection goes here');     mysql_select_db('database name', $conn) or die( "unable select database");     $query="insert prayerrequests (submitdate, submitby, submitemail, prayerrequest, posted, approved) values ('$today', '$user','','”.str_replace(“’”, “’’”, $request1).”',1, 1)";     $result = mysql_query($query) or die("unable update database"); 

thanks help.

not sure of double quotes let's try :

http://www.php.net/manual/fr/function.mysql-real-escape-string.php

$query="insert prayerrequests (submitdate, submitby, submitemail, prayerrequest, posted, approved) values ('$today', '$user','','".mysql_real_escape_string($request1)."',1, 1)"; 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -