致命错误mysql php

时间:2013-12-08 20:46:02

标签: php mysql

我正在尝试使用php将数据插入到我的mysql数据库中。当我这样做时,我收到错误消息:可捕获的致命错误:类mysqli_result的对象无法在第145行的order_handle.php中转换为字符串。

这是第144-152行;

$payment_date = $year."-".$month_number."-".$day;
$insert_ho = "insert into shirt_orders (order_total, payment_date, shirt_credit_cards_id, shirt_shipping_addresses_id, shirt_billing_addresses_id, shirt_shipping_methods_id) values ('$order_total', '$payment_date', '$shirt_credit_cards_id', '$shirt_shipping_addresses_id', '$shirt_billing_addresses_id', '$shirt_shipping_methods_id')";
$exec_insert_ho = @mysqli_query($link, $insert_ho);
if (!$exec_insert_ho) {
    rollback_die("The insertion into shirt_orders was unsuccessful because: ".mysqli_error($link));
} else {
    $shirt_orders_id = mysqli_insert_id($link);
    $insert_gut = "insert into shirt_users_types (shirt_users_id, shirt_orders_id, type_quantity, type_total) values ($shirt_users_id, '$shirt_orders_id', '$qty', '$order_total')";
    $exec_insert_gut = @mysqli_query($link, $insert_gut);

我不太清楚错误是什么。我已经在网站上回顾了几个类似于此的其他问题,但没有一个真正解决过类似的问题。任何帮助都会很棒!

1 个答案:

答案 0 :(得分:0)

我认为错误在数据中。您是否有触发错误的数据示例?如果在mysql客户端中运行查询会发生什么?