General Introduction
Features
Settings
Email system
Date and Time
URL rewrite
Special constants
Special variables
Complex logic in filter
CharToDateFunction
Commit
CompareDates
Connect
CurrentDateFunction
CurrentTimeFunction
DateFormatToPHP
DateToCharFunction
DatetimeToTimestampFunction
Disconnect
ForSql
FormatDate
InitTableVarsForEdit
Insert
IsDate
LastID
NextID
ParseSqlBatch
PrepareFields
PrepareInsert
PrepareUpdate
Query
QueryBind
QueryBindSelect
Rollback
RunSqlBatch
StartTransaction
Update
ForSql
string CDatabase::ForSql( string value, int max_length=0 )
The method prepares the string for insertion into an SQL query (replaces quotes etc.) and optionally truncates it to a specified maximum length, if the max_length parameter is specified. Non-static method.
Parameters
Parameter | Description |
---|---|
value | Original string. |
max_length | Maximum length.
Optional; by default (0) the string is not truncated. |
See Also
Examples of use
<? $strSql = " SEL ECT ID FR OM b_stat_phrase_list WHERE PHRASE='".$DB->ForSql($search_phrase)."' and SESSION_ID='".$_SESSION["SESS_SESSION_ID"]."' "; $w = $DB->Query($strSql, false, $err_mess.__LINE__); ?>
© «Bitrix24», 2001-2023
Up