dbx_escape_string dbx_escape_string (PHP 4 >= 4.3.0, PHP 5 <= 5.0.4)
dbx_escape_string --
Escape a string so it can safely be used in an sql-statement
Description string
dbx_escape_string ( object link_identifier, string text )
dbx_escape_string() returns the text, escaped
where necessary (such as quotes, backslashes etc). It returns
NULL on error.
Example 1. dbx_escape_string() example
<?php $link = dbx_connect ( DBX_MYSQL , "localhost" , "db" , "username" , "password" ) or die( "Could not connect" ); $text = dbx_escape_string ( $link , "It\'s quoted and backslashed (\\)." ); $result = dbx_query ( $link , "insert into tbl (txt) values ('" . $text . "')" ); if ( $result == 0 ) { echo dbx_error ( $link ); } dbx_close ( $link ); ?>
See also dbx_query() .
Links
iPowerWeb $7.95/mo 50GB Diskspace 750GB Bandwidth CGI Perl PHP SSI SSL MySQL Free Domain Name HostGator $9.95/mo 100GB Diskspace 1000GB Bandwidth Host Unlimited Domains CPanel PHP CGI SSH SSI Instant Backups 99.9% Uptime Guarantee 30 Day Money Back Aplus.net $7.46/mo 170GB Diskspace 2000GB Bandwidth PHP Perl Ruby C/C++ Python TCL SSI CGI 2 Free Domain Names DNS Management 99.99% Uptime
Hosting Companies
Partners