mirror of
https://github.com/dg/dibi.git
synced 2025-10-23 02:36:04 +02:00
DibiMysqlDriver & DibiPostgreSql: escape() checks if resource is alive [Closes #46]
This commit is contained in:
@@ -300,9 +300,15 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
||||
{
|
||||
switch ($type) {
|
||||
case dibi::TEXT:
|
||||
if (!is_resource($this->connection)) {
|
||||
throw new DibiException('Lost connection to server.');
|
||||
}
|
||||
return "'" . mysql_real_escape_string($value, $this->connection) . "'";
|
||||
|
||||
case dibi::BINARY:
|
||||
if (!is_resource($this->connection)) {
|
||||
throw new DibiException('Lost connection to server.');
|
||||
}
|
||||
return "_binary'" . mysql_real_escape_string($value, $this->connection) . "'";
|
||||
|
||||
case dibi::IDENTIFIER:
|
||||
|
Reference in New Issue
Block a user