|
Revision 9662, 1.7 kB
(checked in by FabianLange, 5 years ago)
|
reverted r8506 & made mysql timestamp more robust. fixed #3647
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id Rev Date
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
class sfMySQLiSessionStorage extends sfMySQLSessionStorage |
|---|
| 26 |
{ |
|---|
| 27 |
|
|---|
| 28 |
* Execute an SQL Query |
|---|
| 29 |
* |
|---|
| 30 |
* @param string $query The query to execute |
|---|
| 31 |
* @return mixed The result of the query |
|---|
| 32 |
*/ |
|---|
| 33 |
protected function db_query($query) |
|---|
| 34 |
{ |
|---|
| 35 |
return mysqli_query($this->db,$query); |
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
* Escape a string before using it in a query statement |
|---|
| 40 |
* |
|---|
| 41 |
* @param string $string The string to escape |
|---|
| 42 |
* @return string The escaped string |
|---|
| 43 |
*/ |
|---|
| 44 |
protected function db_escape($string) |
|---|
| 45 |
{ |
|---|
| 46 |
return mysqli_real_escape_string($this->db,$string); |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
* Count the rows in a query result |
|---|
| 51 |
* |
|---|
| 52 |
* @param resource $result Result of a query |
|---|
| 53 |
* @return int Number of rows |
|---|
| 54 |
*/ |
|---|
| 55 |
protected function db_num_rows($result) |
|---|
| 56 |
{ |
|---|
| 57 |
return $result->num_rows; |
|---|
| 58 |
} |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
* Extract a row from a query result set |
|---|
| 62 |
* |
|---|
| 63 |
* @param resource $result Result of a query |
|---|
| 64 |
* @return array Extracted row as an indexed array |
|---|
| 65 |
*/ |
|---|
| 66 |
protected function db_fetch_row($result) |
|---|
| 67 |
{ |
|---|
| 68 |
return $result->fetch_row(); |
|---|
| 69 |
} |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|