我在服务器上将extension=sqlsrv_72_ts_x64
与php一起使用。在我的日志中,我收到此错误:
[08-Nov-2018 15:25:27 America / New_York] PHP警告:无效的参数 在第27行的C:\ PHP \ Zen \ Zendesk \ Tickets.php中为foreach()提供了
使用nts在我的PC上运行它时,它不会引发任何错误并且可以正常运行。
有人知道为什么这可能引发错误或如何解决吗?
<?php
include_once '..\config\config_zd.php';
include_once '.\bin\sql_connect.php';
include_once '.\bin\data_mod.php';
//Set the sql inserts and lookups.
$table = 'tickets';
$recore_type = 'ticket';
$type = 'search';
$script_name = "Tickets";
$sub_table = "v_custom_fields";
//This was added to combat deleted tickets
$delete_tickets = "delete tickets where created_at > getdate() -7 or status <> 'closed'";
$stmt_search = sqlsrv_query( $sqlConn, $delete_tickets);
$clearforfullload = "delete from Table_Updates where [table_name] = 'tickets'";
$stmt_search = sqlsrv_query( $sqlConn, $clearforfullload);
//This test to see if the update or insert needs to be run.
$sql_sel_1 = "select cast(last_updated as date) last_updated from [Table_Updates] where script_name = '".$script_name."' and table_name='".$table."' and type ='".$type."'";
$stmt_search = sqlsrv_query( $sqlConn, $sql_sel_1);
$row_date = sqlsrv_fetch_array($stmt_search);
//****** This is my rows Date: $row_date ******\r\n";
if($row_date !== null or $row_date !== ''){
foreach($row_date as $key=>$update_date){
$date_param = array($update_date -> date);
检查日志还显示:
[08-Nov-2018 15:44:49 America / New_York] PHP致命错误:未捕获 ArgumentCountError:函数insert_date_table()的参数太少, 4在第144行的C:\ PHP \ Zen \ Zendesk \ Tickets.php中传递,恰好5 预期在C:\ PHP \ Zen \ Zendesk \ bin \ sql_connect.php:31堆栈跟踪中:
0 C:\ PHP \ Zen \ Zendesk \ Tickets.php(144):insert_date_table('tickets','search','type:ticket sta ...','Tickets')
1 {main}在第31行的C:\ PHP \ Zen \ Zendesk \ bin \ sql_connect.php中抛出