<br><font size=2 face="sans-serif">Check out dbh-&gt;quote()</font>
<br>
<br><font size=2 face="sans-serif">Keith</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=33%>
<br>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>&quot;luis medrano&quot; &lt;lmzaldivar@gmail.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">Sent by:</font>
<br><font size=1 face="sans-serif">spug-list-bounces+keith.reed=philips.com@pm.org</font>
<p><font size=1 face="sans-serif">2006-10-03 10:35 AM</font>
<td width=66%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">spug-list@pm.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">SPUG: inserting content into mysql database</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Classification</font></div>
<td></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<div align=right>
<br></div></table>
<br>
<br>
<br><font size=3>List,<br>
<br>
I running this code feeding a database:<br>
my $sth1=$dbh-&gt;prepare(&quot;INSERT INTO wp_posts(post_author, post_date,
post_date_gmt, post_content,post_title, post_status, comment_status, ping_status,post_name,
post_modified, post_modified_gmt,guid) <br>
 &nbsp; &nbsp; &nbsp; VALUES('$post_author','$post_date','$post_date_gmt','@post_content','$post_title','$post_status','$comment_status','$ping_status','$post_name','$post_modified','$post_modified_gmt','$guid')&quot;)
&nbsp;or die; # &quot;Couldnt prepare statement: &quot; . dbh-&gt;errstr;
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;my $rv1 = $sth1-&gt;execute();<br>
<br>
<br>
but my problem is if any of the values of @post_content or $post_title
contain apostrophe the script show this error not executing of feeding
the database: <br>
<br>
DBD::mysql::st execute failed: 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 's%20secret%20visits%20to%20heiress/article.do&quot;&gt;Goldsmith
s secret visits to heir ' at line 2 at posting-news.pl<br>
<br>
anybody knows how can I fix this without removing the apostrophe?<br>
<br>
Thanks,<br>
Luis</font><font size=2><tt>_____________________________________________________________<br>
Seattle Perl Users Group Mailing List &nbsp;<br>
 &nbsp; &nbsp; POST TO: spug-list@pm.org<br>
SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list<br>
 &nbsp; &nbsp;MEETINGS: 3rd Tuesdays<br>
 &nbsp; &nbsp;WEB PAGE: http://seattleperl.org/</tt></font>
<br>