fer0an Posted July 24, 2010 Share Posted July 24, 2010 hello I want add some code in my db using php. when I added sentence that have ' (for example L'Opinione 24.07.2010) I recived an error below : Error: exist You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Opinione 24.07.2010'' at line 1 can anyone help me? Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/ Share on other sites More sharing options...
trq Posted July 24, 2010 Share Posted July 24, 2010 You need to make sure all special chars are escaped before you can safely insert them into a database. Take a look at mysql_real_escape_string. Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090572 Share on other sites More sharing options...
robert_gsfame Posted July 24, 2010 Share Posted July 24, 2010 put your code here so that we could help solving the error Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090593 Share on other sites More sharing options...
fer0an Posted July 24, 2010 Author Share Posted July 24, 2010 when I want add this title to my post I recived an error about L'Unitá del 24 <div class="center"><b> L'Unitá del 24 Luglio 2010 </b><br/> Italian | PDF | 48 Pag. | 15.3 MB</div><br/> <div class="center"><b>Download<br/> HotFile<br/> <a href="http://hotfile.com/dl/57125470/2e8b47f/-24-07-2010-u.ni.ta.pdf.html" target="_blank" rel="nofollow">http://hotfile.com/dl/57125470/2e8b47f/-24-07-2010-u.ni.ta.pdf.html</a><br/> SharingMatrix<br/> http://sharingmatrix.com/file/14347009/-24-07-2010-u.ni.ta.pdf<br/> </b></div><br/> <b>Visita anche il mio Blog su AvaxHome<br/> <a href="http://avaxhome.ws/blogs/tenovis" target="_blank" rel="nofollow">my blog</a></b> </div> Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090600 Share on other sites More sharing options...
robert_gsfame Posted July 24, 2010 Share Posted July 24, 2010 You have an error in your SQL syntax means something wrong with the SQL query, what we need is not the html code but the query itself Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090601 Share on other sites More sharing options...
fer0an Posted July 24, 2010 Author Share Posted July 24, 2010 I know but I want add this code with all of char on my db. can you help me? Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090602 Share on other sites More sharing options...
kenrbnsn Posted July 24, 2010 Share Posted July 24, 2010 Thorpe's reply told you what you need to know. Use mysql_real_escape_string on the data when you use it with MySQL. If you show us your code, we can help you better. Ken Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090628 Share on other sites More sharing options...
fer0an Posted July 25, 2010 Author Share Posted July 25, 2010 I want use mysql_real_escape_string() in my text to escape ' anyone can help me for this code? Link to comment https://forums.phpfreaks.com/topic/208754-error-when-i-want-add-code/#findComment-1090871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.