0
我嘗試運行以下查詢,如下所示。Symfony 1.4 Doctrine運行自定義查詢給出警告
$query = "DELETE FROM `ski_chalet_price` WHERE 1";
$conn = Doctrine_Manager::getInstance()->connection();
$stmt = $conn->prepare($query);
$stmt->execute();
但它會引發以下警告。
Warning: Invalid argument supplied for 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
這是我想運行的查詢。
INSERT INTO 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' ;
它不依賴於我的查詢。這有什麼問題?
爲什麼你需要使用原始查詢來運行這種查詢?你不能用教條法來做到這一點嗎? – j0k 2013-04-18 08:50:06
不,我想運行Upsert查詢。我提到簡單的查詢作爲例子。這個結果不依賴於查詢。 – 2013-04-18 09:34:11
然後你可以把你正在嘗試執行的正確的查詢?還有,你在做什麼 – j0k 2013-04-18 11:27:25