Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
g php的订单id自动提交是默认设置,即打开。我不执行手动提交,也不使用事务日期\u创建的字段是DATETIME类型。希望这能有所帮助。@VeeK-我又加了一些。切换到MariaDB,MySQL就输给Oracle了。我喜欢MariaDB的第一件事是它没有_Php_Mysql - Fatal编程技术网

g php的订单id自动提交是默认设置,即打开。我不执行手动提交,也不使用事务日期\u创建的字段是DATETIME类型。希望这能有所帮助。@VeeK-我又加了一些。切换到MariaDB,MySQL就输给Oracle了。我喜欢MariaDB的第一件事是它没有

g php的订单id自动提交是默认设置,即打开。我不执行手动提交,也不使用事务日期\u创建的字段是DATETIME类型。希望这能有所帮助。@VeeK-我又加了一些。切换到MariaDB,MySQL就输给Oracle了。我喜欢MariaDB的第一件事是它没有,php,mysql,Php,Mysql,g php的订单id自动提交是默认设置,即打开。我不执行手动提交,也不使用事务日期\u创建的字段是DATETIME类型。希望这能有所帮助。@VeeK-我又加了一些。切换到MariaDB,MySQL就输给Oracle了。我喜欢MariaDB的第一件事是它没有政治色彩。我喜欢MariaDB的第二件事是它默认在严格模式下运行。错误消息是您最好的朋友。我运行Hoo WinTail,对于错误,我让过滤器在我的MariaDB查询日志上运行C:\cmdmp3win.exe“C:\ding_on.wav”,这样


g php的订单id<代码>自动提交是默认设置,即打开。我不执行手动提交,也不使用事务<代码>日期\u创建的字段是
DATETIME
类型。希望这能有所帮助。@VeeK-我又加了一些。切换到MariaDB,MySQL就输给Oracle了。我喜欢MariaDB的第一件事是它没有政治色彩。我喜欢MariaDB的第二件事是它默认在严格模式下运行。错误消息是您最好的朋友。我运行Hoo WinTail,对于错误,我让过滤器在我的MariaDB查询日志上运行
C:\cmdmp3win.exe“C:\ding_on.wav”
,这样我就可以知道程序在后台以其他方式安静运行时发生任何错误。我没有时间去钻研这个具体问题,我只是希望我的建议能有所帮助。祝你好运主键重复的可能性为零。该查询很好。请在您的答案中添加一些解释,以便其他人可以从中学习
$saveOrderQ = "INSERT INTO orders (order_id, parent_order, date_created, status, type, phase, ticker, quantity, entry_price, tp1, tp2, strategy, relative_volume, distance_from_close) VALUES ({$order->order_id}, 0, '$now', 'OPEN', 'BUY', 0, '$ticker', $positionsSize, $price, $tp1, $tp2, {$tickerAttr['strategy']}, $relativeVol, $distanceFromClose)";
writeToLog($saveOrderQ); // I get the query in the log. This function's log is seperate from mysql log
$saveOrder = mysqli_query($connect, $saveOrderQ);
if(!$saveOrder){
    writeToLog("Failed to insert file 30daybreakout.php Line 59. Error: ".mysqli_error($connect)."\nQuery: $saveOrderQ"); // no error received
}
2020-04-13T09:23:02.222315+05:30    127059 Query    SELECT order_id FROM orders WHERE ticker = 'NSE:BALMLAWRIE' AND DATE(date_created) = '2020-04-13' AND parent_order = 0 AND phase < 3
2020-04-13T09:23:02.356930+05:30    127059 Query    INSERT INTO orders (order_id, parent_order, date_created, status, type, phase, ticker, quantity, entry_price, tp1, tp2, strategy, relative_volume, distance_from_close) VALUES (200413000329794, 0, '2020-04-13 09:23:01', 'OPEN', 'BUY', 0, 'NSE:BALMLAWRIE', 54, 91.3, 94.95, 98.6, 1, 108.87022900763, 6.5966141272621)
$saveOrderCount = 0;
do {
    $saveOrder = mysqli_query($connect, $saveOrderQ);
    $saveOrderCount++;
} while(!mysqli_affected_rows($connect) and $saveOrderCount < 3); //Will retry upto a max of 3 times

if($saveOrderCount >= 3){
    writeToLog("Failed to insert in file test.php Line 59. Error: ".mysqli_error($connect)."\nQuery: $saveOrderQ");
}
AND date_created >= '2020-04-13'
AND date_created  < '2020-04-13' + INTERVAL 1 DAY
INDEX(ticker, parent, date_created)
INSERT INTO orders (order_id, parent_order, date_created, status, type, phase, ticker, quantity, entry_price, tp1, tp2, strategy, relative_volume, distance_from_close) VALUES (200413000329794, 0, '2020-04-13 09:23:01', 'OPEN', 'BUY', 0, 'NSE:BALMLAWRIE', 54, 91.3, 94.95, 98.6, 1, 108.87022900763, 6.5966141272621)