Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : dbx Functions : dbx_escape_string

dbx_escape_string

Escape a string so it can safely be used in an sql-statement (PHP 4 >= 4.3.0, PHP 5 <= 5.0.5, PECL dbx:1.1.0)
string dbx_escape_string ( object link_identifier, string text )

Example 491. 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);
?>

Change Language


Follow Navioo On Twitter
dbx_close
dbx_compare
dbx_connect
dbx_error
dbx_escape_string
dbx_fetch_row
dbx_query
dbx_sort
eXTReMe Tracker