downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

dbx_fetch_row> <dbx_error
[edit] Last updated: Fri, 25 May 2012

view this page in

dbx_escape_string

(PHP 4 >= 4.3.0, PHP 5 <= 5.0.5, PECL dbx >= 1.1.0)

dbx_escape_string Protège une chaîne de caractères pour l'utiliser dans une requête

Description

string dbx_escape_string ( object $link_identifier , string $text )

Protège une chaîne de caractères pour l'utiliser dans une requête.

Liste de paramètres

link_identifier

L'objet DBX retourné par la fonction dbx_connect()

text

La chaîne à échapper

Valeurs de retour

Retourne le texte text dont les caractères spéciaux ont été protégés (les guillemets, les antislash...). Si une erreur survient, NULL sera retourné.

Exemples

Exemple #1 Exemple avec dbx_escape_string()

<?php
$link   
dbx_connect(DBX_MYSQL"localhost""db""username""password")
    or die(
"Impossible de se connecter");

$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);
?>

Voir aussi

  • dbx_query() - Envoie une requête et lit tous les résultats DBX



add a note add a note User Contributed Notes dbx_escape_string
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites