1

i have an update query that i am getting error

Message: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match  number of tokens 

i would like to have my query display so that i could debug it. any ideas how to do this

EDIT:: on my page.php model i have and Page model extends Zend_Db_Table_Abstract

public static function updatePage($data, $id)
{       
    $row = new self();
    $row->update($data, "page_id = ?".$id);
}
S L
  • 14,262
  • 17
  • 77
  • 116
  • $row->update($data, "page_id =".$id); solved my problem but still question remains open so what it would be easier to debug our db application – S L Jan 21 '11 at 11:11

1 Answers1

7

If you use "Zend_Db_Select":

<?php

Zend_Debug::dump($select->__toString()); // nice formatted debug
echo $select; // altough ok !
opHASnoNAME
  • 20,224
  • 26
  • 98
  • 143
  • @ArneRie can't i dump out my update query that is built be the above code. Please check edits – S L Jan 21 '11 at 10:33
  • @ArneRie it does not show update query (db profiler shows only successful query) – S L Jan 21 '11 at 10:46
  • ok check the last response to this topic, not elegant but working :-) http://stackoverflow.com/questions/1009639/zend-db-framework-examine-query-for-an-update – opHASnoNAME Jan 21 '11 at 10:50