
The following SQL statement produces a SQL error:
$prepared = $this->db->prepare("UPDATE documents SET %r = %s WHERE document_id = %i");
$this->db->query($prepared, 'author', 'theyouyou', 23);
SQL error (translated from french) :
PostgreSQL error (ERROR: bind message passes 3 parameters but the prepared statement fstm1 needs 0) in {false}
BTW the "normal" statement cause no error
fStatement object (in firephp):
bound_params =
database = fDatabase(...)
identifier = 'fstmt1'
placeholders = array(
[0] => '%s' // Where's the '%r' ?
[1] => '%i'
)
statement = Resource id #41
sql =
untranslated_sql =
used =
)
The PHP Log:
{doc_root}\\slire3\\app\\model\\Document.php(126): fDatabase->prepare('UPDATE document...')
{doc_root}\\slire3\\lib\\flourish\\fDatabase.php(2663): fDatabase->prepareStatement('UPDATE document...')
{doc_root}\\slire3\\lib\\flourish\\fDatabase.php(2759): fStatement->__construct(Object(fDatabase), 'UPDATE document...', Array, NULL)
{doc_root}\\slire3\\lib\\flourish\\fStatement.php(101): vsprintf('UPDATE document...', Array)
[internal function]
vsprintf(): Too few arguments
What's wrong ?