我一直在尝试将MySQL_转换为MySQLi时遇到问题,因此有可能有人愿意通过转换此SQL查询来帮助我吗?
$sql="INSERT INTO `paypal_mysqltable_name` (datenow, item_name, item_number, payment_status, payment_amount, payment_currency, payer_email, payment_type, custom,
invoice, first_name, last_name, address_name, address_country, address_country_code, address_zip, address_state, address_city, address_street)
VALUES (CURRENT_TIMESTAMP,'item_name','$item_number','$payment_status', '$payment_amount','$payment_currency','$payer_email', '$payment_type','$custom' ,'$invoice','$first_name','$last_name','$address_name','$address_country','$address_country_code','$address_zip','$address_state','$address_city','$address_street')";
例如:对于这样的声明?
$stmt = $mysqli->prepare("
答案 0 :(得分:-1)
看起来像这样:
$stmt = $mysqli->prepare("INSERT INTO `paypal_mysqltable_name` (datenow, item_name, item_number, payment_status, payment_amount, payment_currency, payer_email, payment_type, custom,
invoice, first_name, last_name, address_name, address_country, address_country_code, address_zip, address_state, address_city, address_street)
VALUES (CURRENT_TIMESTAMP,'item_name', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->execute(array(
$item_number,
$payment_status,
$payment_amount,
$payment_currency,
$payer_email,
$payment_type,
$custom,
$invoice,
$first_name,
$last_name,
$address_name,
$address_country,
$address_country_code,
$address_zip,
$address_state,
$address_city,
$address_street
));