
Kanji
User
/ Moderator
Oct 16, 2000, 8:53 AM
Post #3 of 3
(2246 views)
|
Re: Single quotes in sql-queries
[In reply to]
|
Can't Post
|
|
You can also use placeholders which just looks neater and lets DBI work out quoting issues itself... <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $sth = $dbh->prepare( "INSERT INTO example ( id, name ) VALUES ( ?, ? )" ); $sth->execute( "10", "john's book" );</pre><HR></BLOCKQUOTE>
|