mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
pdo statement->execute expects either the prepared statement with already bound parameters OR an array of the vars to be bound. It can NOT handle them MIXED
This commit is contained in:
parent
3e33651c5d
commit
7e34a7c999
@ -326,18 +326,26 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
if ($this->operation == self::STORE2FS)
|
||||
{
|
||||
$stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_size=:fs_size,fs_mime=:fs_mime,fs_modifier=:fs_modifier,fs_modified=:fs_modified WHERE fs_id=:fs_id');
|
||||
if (!($ret = $stmt->execute($values)))
|
||||
{
|
||||
error_log(__METHOD__."() execute() failed! errorInfo()=".array2string(self::$pdo->errorInfo()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_size=:fs_size,fs_mime=:fs_mime,fs_modifier=:fs_modifier,fs_modified=:fs_modified,fs_content=:fs_content WHERE fs_id=:fs_id');
|
||||
$this->stream_seek(0,SEEK_SET); // rewind to the start
|
||||
$stmt->bindParam('fs_content', $this->opened_stream, PDO::PARAM_LOB);
|
||||
foreach($values as $name => &$value)
|
||||
{
|
||||
$stmt->bindParam($name,$value);
|
||||
}
|
||||
if (!($ret = $stmt->execute($values)))
|
||||
$stmt->bindParam('fs_content', $this->opened_stream, PDO::PARAM_LOB);
|
||||
if (!($ret = $stmt->execute()))
|
||||
{
|
||||
error_log(__METHOD__."() execute() failed! errorInfo()=".array2string(self::$pdo->errorInfo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret = fclose($this->opened_stream) && $ret;
|
||||
|
||||
unset(self::$stat_cache[$this->opened_path]);
|
||||
|
Loading…
Reference in New Issue
Block a user