我遇到了MySQLi查询的问题,我无法找出原因。
当自己执行查询(使用phpmyadmin)时,它运行得很好。所以当用php执行它时它不会抛出任何错误。请参阅下面的详细信息。
在SO上已经有关于此的其他帖子,但没有一个能解决我的问题。虽然我知道这可能是我忽视的一个愚蠢的错误,但这有点时间敏感,所以欢迎所有支持。
将填充数组的代码将被输入函数
INSERT ON COFLICT DO
执行数据库查询的函数:
MERGER
mysqli_stmt有所有空值,我不知道原因,但是所有,没有错误:
....
//Prepare DB Data
$NewNodesData = array();
foreach($NewNodes as $NewNode){
//Actual Data
$NewNodesData[$NewNode['Node_Name']]['Node_Name'] = $NewNode['Node_Name'] ;
$NewNodesData[$NewNode['Node_Name']]['Platform'] = $NewNode['Platform'] ;
$NewNodesData[$NewNode['Node_Name']]['Policy_Domain'] = $NewNode['Policy_Domain'] ;
$NewNodesData[$NewNode['Node_Name']]['ProxyNode_target'] = $NewNode['ProxyNode_target'] ;
$NewNodesData[$NewNode['Node_Name']]['ProxyNode_Agent'] = $NewNode['ProxyNode_Agent'] ;
//Set empty fields(will be polulated later)
$NewNodesData[$NewNode['Node_Name']]['server_name'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['unique_ident'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['exp_suc'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['active'] = 1 ;
$NewNodesData[$NewNode['Node_Name']]['kostenplaats'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['contact'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['schedule'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['filespace_name'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['fsid'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['mgmtclass'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['script'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['comment'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['node_data'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['host_node'] = NULL ;
$NewNodesData[$NewNode['Node_Name']]['editedby'] = "Auto Import Script" ;
$NewNodesData[$NewNode['Node_Name']]['editedts'] = time() ;
$NewNodesData[$NewNode['Node_Name']]['fsid_tsm2'] = NULL ;
}
//Save new nodes to DB
foreach($NewNodesData as $NewNodeData){
$user_name = "Auto Import Script";
echo CreateTDPNode($NewNodeData);
}
任何提示都表示赞赏!