代码之家  ›  专栏  ›  技术社区  ›  KinsDotNet

为什么这个查询没有插入或失败,而且似乎根本没有在PDO中处理?

  •  0
  • KinsDotNet  · 技术社区  · 6 年前

    我使用的是在 https://phpdelusions.net/pdo/pdo_wrapper

    我有以下疑问

                    $new_app_insert_query = DB::run('INSERT INTO applicant_education_record (
                                            id_applicant_account,
                                            institution,
                                            diploma_certificate_type,
                                            dates_of_attendance,
                                            major,
                                            date_of_degree,
                                            gpa,
                                            city_of_institution,
                                            state_or_country_of_institution,
                                            institution_b,
                                            diploma_certificate_type_b,
                                            dates_of_attendance_b,
                                            major_b,
                                            date_of_degree_b,
                                            gpa_b,
                                            city_of_institution_b,
                                            state_or_country_of_institution_b,
                                            institution_c,
                                            diploma_certificate_type_c,
                                            dates_of_attendance_c,
                                            major_c,
                                            date_of_degree_c,
                                            gpa_c,
                                            city_of_institution_c,
                                            state_or_country_of_institution_c,
                                            institution_d,
                                            diploma_certificate_type_d,
                                            dates_of_attendance_d,
                                            major_d,
                                            date_of_degree_d,
                                            gpa_d,
                                            city_of_institution_d,
                                            state_or_country_of_institution_d,
                                            institution_e,
                                            diploma_certificate_type_e,
                                            dates_of_attendance_e,
                                            major_e,
                                            date_of_degree_e,
                                            gpa_e,
                                            city_of_institution_e,
                                            state_or_country_of_institution_e,
                                            institution_f,
                                            diploma_certificate_type_f,
                                            dates_of_attendance_f,
                                            major_f,
                                            date_of_degree_f,
                                            gpa_f,
                                            city_of_institution_f,
                                            state_or_country_of_institution_f,
                                            institution_g,
                                            diploma_certificate_type_g,
                                            dates_of_attendance_g,
                                            major_g,
                                            date_of_degree_g,
                                            gpa_g,
                                            city_of_institution_g,
                                            state_or_country_of_institution_g,
                                            institution_h,
                                            diploma_certificate_type_h,
                                            dates_of_attendance_h,
                                            major_h,
                                            date_of_degree_h,
                                            gpa_h,
                                            city_of_institution_h,
                                            state_or_country_of_institution_h,
                                            transcript_a,
                                            transcript_b,
                                            transcript_c,
                                            transcript_d,
                                            transcript_e,
                                            transcript_f,
                                            transcript_g,
                                            transcript_h) 
                                            VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',$binds);
                                            header("Location: ../new_app_acct_4.php");
    

    我的绑定数组看起来像:

    $binds = [
                    $_POST['id_applicant_account'],
                    $_POST['institution'],
                    $_POST['diploma_certificate_type'],
                    $dates_of_attendance,
                    $_POST['major'],
                    $_POST['date_of_degree'],
                    $_POST['gpa'],
                    $_POST['city_of_institution'],
                    $_POST['state_or_country_of_institution'],
    
                    $_POST['institution_b'],
                    $_POST['diploma_certificate_type_b'],
                    $dates_of_attendance_b,
                    $_POST['major_b'],
                    $_POST['date_of_degree_b'],
                    $_POST['gpa_b'],
                    $_POST['city_of_institution_b'],
                    $_POST['state_or_country_of_institution_b'],
    
                    $_POST['institution_c'],
                    $_POST['diploma_certificate_type_c'],
                    $dates_of_attendance_c,
                    $_POST['major_c'],
                    $_POST['date_of_degree_c'],
                    $_POST['gpa_c'],
                    $_POST['city_of_institution_c'],
                    $_POST['state_or_country_of_institution_c'],
    
                    $_POST['institution_d'],
                    $_POST['diploma_certificate_type_d'],
                    $dates_of_attendance_d,
                    $_POST['major_d'],
                    $_POST['date_of_degree_d'],
                    $_POST['gpa_d'],
                    $_POST['city_of_institution_d'],
                    $_POST['state_or_country_of_institution_d'],
    
                    $_POST['institution_e'],
                    $_POST['diploma_certificate_type_e'],
                    $dates_of_attendance_e,
                    $_POST['major_e'],
                    $_POST['date_of_degree_e'],
                    $_POST['gpa_e'],
                    $_POST['city_of_institution_e'],
                    $_POST['state_or_country_of_institution_e'],
    
                    $_POST['institution_f'],
                    $_POST['diploma_certificate_type_f'],
                    $dates_of_attendance_f,
                    $_POST['major_f'],
                    $_POST['date_of_degree_f'],
                    $_POST['gpa_f'],
                    $_POST['city_of_institution_f'],
                    $_POST['state_or_country_of_institution_f'],
    
                    $_POST['institution_g'],
                    $_POST['diploma_certificate_type_g'],
                    $dates_of_attendance_g,
                    $_POST['major_g'],
                    $_POST['date_of_degree_g'],
                    $_POST['gpa_g'],
                    $_POST['city_of_institution_g'],
                    $_POST['state_or_country_of_institution_g'],
    
                    $_POST['institution_h'],
                    $_POST['diploma_certificate_type_h'],
                    $dates_of_attendance_h,
                    $_POST['major_h'],
                    $_POST['date_of_degree_h'],
                    $_POST['gpa_h'],
                    $_POST['city_of_institution_h'],
                    $_POST['state_or_country_of_institution_h'],
                    'no','no','no','no','no','no','no','no'
                ];
    

    运行应用程序时,不会出现任何MySQL或php错误。表单提交成功,然后重定向到new_app_acct_4.php。数据库没有用新插入的记录进行更新,PHP或MySQL都不会抛出任何错误。任何试图排除故障的建议都将不胜感激。

    0 回复  |  直到 6 年前
    推荐文章