symfony1 - Symfony 1.4 Doctrine run custom query give warnings -


i try run following query follows.

 $query = "delete `ski_chalet_price` 1";       $conn = doctrine_manager::getinstance()->connection();  $stmt = $conn->prepare($query);  $stmt->execute(); 

but throws following warning.

warning: invalid argument supplied foreach() in /home/dinuka/workspace/symfony/lib/plugins/sfdoctrineplugin/lib/database/sfdoctrineconnectionprofiler.class.php on line 196  warning: join(): invalid arguments passed in /home/dinuka/workspace/symfony/lib/plugins/sfdoctrineplugin/lib/database/sfdoctrineconnectionprofiler.class.php on line 141 

this query want run.

insert ski_chalet_price  (ski_chalet_id, month, d_19,d_20,d_21,d_22,d_23,d_24,d_25,created_at) values (44,'2013-04-01',10,10,10,10,10,10,10,'2013-04-19 13:27:26')  on duplicate key update  ski_chalet_id = 44, month = '2013-04-01',d_19 = 10,d_20 = 10,d_21 = 10,d_22 = 10,d_23 = 10,d_24 = 10,d_25 = 10, updated_at = '2013-04-19 13:27:26' ; 

it not depend on query. whats issue?

i inspected code on sfdoctrineconnectionprofiler.class.php , found out execute(); needs empty set of parameters (i.e. empty array) in order not complain.

so:

$stmt->execute(); 

should be:

$stmt->execute(array()); 

note "join" word in error misleading. it's not referring sql join, php's native join() function alias of implode().


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -