save to db with wpdb
-
I am using this in a function to save a form input to a table
$success = $wpdb->insert( $table_name, array( ‘Title’ => $title, ‘first_name’ => $firstname, ‘surname’ => $surname, ‘DOB’ => $dob, ‘Sex’ => $sex, ‘HouseNumberName’ => $housenumbername, ‘StreetRoad’ => $streetroad, ‘TownCityVillage’ => $towncityvillage, ‘CountyStateRegion’ => $countystateregion, ‘Postcode’ => $postcode, ‘country’ => $country, ‘Nationality’ => $nationality, ‘your_email’ => $youremail, ‘confirm_email_425’ => $youremail, ‘telephone’ => $telephone, ‘role’ => $role_string, ‘English_Level’ => $englishlevel, ‘photo1_path’ => $path1, ‘photo_1’ => $photo1, ‘photo_1_img’ => $imgContent1, ‘photo2_path’ => $path2, ‘photo_2’ => $photo2, ‘photo_2_img’ => $imgContent2, ‘previous_work’ => $previouswork, ‘year_last_worked’ => $yearlastworked, ‘Available_From’ => $availablefrom, ‘Available_To’ => $availableto, ‘bankaccount’ => $bankaccount, ‘IDL’ => $idl, ‘EnhancedLic’ => $enhancedlic_string, ‘OEL’ => $oel, ‘PassportID’ => $passportid, ‘NI’ => $ni, ‘accommodation’ => $accommodation, ‘Education’ => $education, ‘Experience’ => $experience, ‘Other’ => $other, ‘AccompanyingName1’ => $acc1, ‘Relationship1’ => $rel1, ‘AccompanyingEmail1’ => $accemail1, ‘confirm_email_775’ => $accemail1, ‘AccompanyingName2’ => $acc2, ‘Relationship2’ => $rel2, ‘AccompanyingEmail2’ => $accemail2, ‘confirm_email_776’ => $accemail2, ‘AccompanyingName3’ => $acc3, ‘Relationship3’ => $rel3, ‘AccompanyingEmail3’ => $accemail3, ‘confirm_email_777’ => $accemail3, ‘acceptance_323’ => $accept, ‘datestamp’ => $datetime ));
I have checked that there are 51 columns excluding the auto-imcrementing primary key ‘id’ and that the field names are as per the table but it won’t write to the table, anyone have any idea why please?
- The topic ‘save to db with wpdb’ is closed to new replies.