PHP Mysqli-插入未保存到数据库

PHP Mysqli-插入未保存到数据库,php,mysql,mysqli,insert,Php,Mysql,Mysqli,Insert,我有一个函数,应该将数组存储到我的mysql表中,但数据库中没有显示任何内容。这是我第一次像以前一样使用Mysql 向函数传递一个保存在数据库中的$uniqueRef ID、工作单数组、$coreSales(另一个保存在数据库中的数组)和$mysqli(传递mysqli连接) 这是我的代码: 谢谢您是否费心检查每个函数的返回值?prepare、bind_param和execute在失败时都将返回布尔值false,除非您启用了异常。这是需要处理的大量参数之一-您确定您的字段:参数:绑定之间有1:1

我有一个函数,应该将数组存储到我的mysql表中,但数据库中没有显示任何内容。这是我第一次像以前一样使用Mysql

向函数传递一个保存在数据库中的$uniqueRef ID、工作单数组、$coreSales(另一个保存在数据库中的数组)和$mysqli(传递mysqli连接)

这是我的代码:


谢谢

您是否费心检查每个函数的返回值?prepare、bind_param和execute在失败时都将返回布尔值false,除非您启用了异常。这是需要处理的大量参数之一-您确定您的字段:参数:绑定之间有1:1:1的匹配吗?这里没有足够的信息来知道出现了什么问题,但是您的一些基本调试可能会有所帮助。首先,确保脚本的错误报告级别为-1,以确保所有错误级别都处于启用状态,然后记录错误或显示错误以获取所有错误信息。在你的问题中包括所说的错误。这段代码不包含语法错误,参数匹配也很清楚,但对潜在的运行时错误一无所知。我甚至不打算开始计算这些错误。我在7点后迷失方向。我将在脚本上启用错误报告并发回。我使用了Count,所有的都是1:1:1。每个都有46个感谢解决了我用于错误报告的问题
function storeInDB($uniqueRef, $wo, $coreSales, $mysqli){
    $accountStatus = 0;
    $requiresAttention = 2;

    $stmt = $mysqli->prepare("INSERT INTO `workorder`(`id`, `uniqueRef`, `rep`, `repemail`, `date`, `event`, `otherNotes`, `repNotes`, `bookingNotes`, `reqInstallDate`, `tripplePlayPromo`, `fullName`, `address`, `contactNumber`, `accountNumber`, `custID`, `custEmail`, `cblPackage`, `cblNotes`, `cblEquipment`, `cblPromo`, `internetPackage`, `internetNotes`, `internetEquipment`, `internetPromo`, `phonePackage`, `phonePromo`, `portingNumber`, `phoneBook`, `portornew`, `cellorlandline`, `companyPortingfrom`, `servicesToDisco`, `alarm`, `intercom`, `nameOnBill`, `cellAccount`, `fromAddress`, `phoneNotes`, `creditName`, `creditContactNumber`, `creditAddress`, `creditAccount`, `status`, `requiresattention`, `creditAmount`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");


$stmt->bind_param('issssssssssssssssssssssssssssssssssssssssssiii',
    $idNum,
    $uniqueRef,
    $wo['rep'],
    $wo['repemail'],
    $wo['date'],
    $wo['event'],
    $wo['otherNotes'],
    $wo['repNotes'],
    $wo['bookingNotes'],
    $wo['reqInstallDate'],
    $wo['tripplePlayPromo'],
    $wo['fullName'],
    $wo['address'],
    $wo['contactNumber'],
    $wo['accountNumber'],
    $wo['custID'],
    $wo['custEmail'],
    $wo['cblPackage'],
    $wo['cblNotes'],
    $wo['cblEquipment'],
    $wo['cblPromo'], 
    $wo['internetPackage'],
    $wo['internetNotes'], 
    $wo['internetEquipment'], 
    $wo['internetPromo'], 
    $wo['phonePackage'], 
    $wo['phonePromo'],
    $wo['portingNumber'], 
    $wo['phoneBook'],
    $wo['portornew'], 
    $wo['cellorlandline'], 
    $wo['companyPortingfrom'], 
    $wo['servicesToDisco'], 
    $wo['alarm'],
    $wo['intercom'], 
    $wo['nameOnBill'], 
    $wo['cellAccount'], 
    $wo['fromAddress'],
    $wo['phoneNotes'],
    $wo['creditName'], 
    $wo['creditContactNumber'],
    $wo['creditAddress'],
    $wo['creditAccount'],
    $accountStatus,//Status
    $requiresAttention,
    $creditAmount);//Requires Attention



    echo $mysqli->error;
    $stmt->execute();
    $idNum = $mysqli->insert_id;
    $stmt->close();

    echo "<br>Stored in DB ID#" .$idNum ;
    return $idNum;
}