PHP: dbx_escape_string - Manual

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

search for in the

dbx_fetch_row dbx_error

Last updated: Sat, 27 Jan 2007

view this page in

# 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

## Описание

string dbx_escape_string ( object link_identifier, string text )

Escape the given string so that it can safely be used in an sql-statement.

## Список параметров

`link_identifier`

  The DBX link object returned by dbx_connect()

`text`

  The string to escape.

## Возвращаемые значения

Returns the text, escaped where necessary (such as quotes, backslashes etc). On error, `NULL` is returned.

## Примеры

Пример 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);
?>`

## Смотрите также

dbx_query()

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

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST