| | |
| | | * Formats input so it can be safely used in a query |
| | | * |
| | | * @param mixed $input Value to quote |
| | | * @param string $type Type of data |
| | | * @param string $type Type of data (integer, bool, ident) |
| | | * |
| | | * @return string Quoted/converted string for use in query |
| | | */ |
| | |
| | | |
| | | if (is_null($input)) { |
| | | return 'NULL'; |
| | | } |
| | | |
| | | if ($type == 'ident') { |
| | | return $this->quote_identifier($input); |
| | | } |
| | | |
| | | // create DB handle if not available |
| | |
| | | $name[] = $start . $elem . $end; |
| | | } |
| | | |
| | | return implode($name, '.'); |
| | | return implode($name, '.'); |
| | | } |
| | | |
| | | /** |
| | |
| | | * Return list of elements for use with SQL's IN clause |
| | | * |
| | | * @param array $arr Input array |
| | | * @param string $type Type of data |
| | | * @param string $type Type of data (integer, bool, ident) |
| | | * |
| | | * @return string Comma-separated list of quoted values for use in query |
| | | */ |