LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[Webdev] DBI->quote equivalent in PHP

[Webdev] DBI->quote equivalent in PHP

Thomas Bridge thomas.bridge at via-net-works.ie
Fri Aug 25 10:26:50 IST 2000


If I have a string of "unknown content" (eg a string gathered from user 
input) which I then want to use in a (My)SQL statement, I can escape any 
"dodgy" characters in Perl like so:

$safestring = $dbh->quote($string);
$sqlstatement = "INSERT INTO table (textfield) VALUES ($safestring)";

What's the functional equivalent of this in PHP (preferably a solution that 
works in PHP 3.0.16)?

T.
Thomas Bridge					26 Upper Fitzwilliam St.,
Senior Hostmaster/Sysadmin,			Dublin 2,
VIA NET.WORKS Ireland.			Ph: +353 1 6763600
thomas.bridge at via-net-works.ie		Fax: +353 1 6627674





More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell