Mysqli_stmt_bind_param cannot handle the time type? Solution Ideas

Source: Internet
Author: User
Mysqli_stmt_bind_param cannot handle the time type?
This statement of error
Mysqli_stmt_bind_param ($stmt, ' idii ', $c, $a, $t, $w);


Full code
 Require (' inc/config.php ');
$page _title = ' Residential Data add-feige data center ';
Include (' inc/header.php ');
Require (MYSQL);
if ($_server[' request_method '] = = ' POST ') {
$trimmed = Array_map (' Trim ', $_post);
$errors = Array ();
if (Empty ($trimmed [' wdate '])) {
$errors [] = ' date cannot be empty ';
} else {
$w = mysqli_real_escape_string ($conn, $trimmed [' wdate ']);
}

if (Isset ($trimmed [' City ']) && Filter_var ($trimmed ["City"], Filter_validate_int, Array (' city ' = 1)) {
$c = mysqli_real_escape_string ($conn, $trimmed [' City ']);;
} else {
$errors [] = ' Please select region ';
}

if (Is_numeric ($trimmed [' Taoshu ']) && ($trimmed [' Taoshu '] > 0)} {
$t = Mysqli_real_escape_string ($conn, (int) $trimmed [' Taoshu ']);
} else {
$errors [] = ' Please enter the correct units ';
}
if (Is_numeric ($trimmed [' area ']) && ($trimmed [' area '] > 0)} {
$a = mysqli_real_escape_string ($conn, (float) $trimmed [' area '];
} else {
$errors [] = ' Please enter a correct area ';
}


if (empty ($errors)) {
$q = ' INSERT into F_chengjiao (city_id, area, Taoshu, Fang_time, Os_time) VALUES (?,?,?,?,?, Now ()) ';
$stmt = Mysqli_prepare ($conn, $q);
Mysqli_stmt_bind_param ($stmt, ' idii ', $c, $a, $t, $w);
Mysqli_stmt_execute ($stmt);

if (mysqli_stmt_affected_rows ($stmt) = = 1) {
Echo '

This data has been added

';
$_post = Array ();
} else {
Echo '

The program has an error, please re-add

';
}
Mysqli_stmt_close ($stmt);
}
}

if (!empty ($errors) && Is_array ($errors)) {
Echo '

The following error occurred:
';
foreach ($errors as $msg) {
echo "-$msg
\ n ";
}
Echo ' Please try it again

';
}

?>

Home Data Additions




Include (' inc/footer.php ');
?>



Error notification
Error file is ' D:\wamp\www\zhuzhai_add.php ' error line number is 36:mysqli_stmt_bind_param () expects parameter 1 to be mysqli_stmt, Boolean give N
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.