CodeCharge StudioThis function converts values to the specified data type in order to make them SQL compatible. No active connection needed.
CCToSQL(Value, DataType)
| Name | Type | Description | Required |
|---|---|---|---|
| Value | any | A value to be converted to SQL compatible format. | Yes |
| DataType | The data type the value will be converted to. You can use any of the predefined constants: ccsDate, ccsBoolean, ccsInteger, ccsFloat, ccsText, ccsMemo | Desired data type. | Yes |
$SQL = "SELECT user_name "
. "FROM users "
. "WHERE user_id = " & CCToSQL(CCGetSession("UserID"),ccsInteger)
$db->query($SQL);