I am simply trying to use insert_batch() but it’s not even inserting in my table as well and not even showing an error. But I am sure the flow of control has passed through the function insert_batch().
I have tried to include every field that is available in the table with ” and null value too but still does not works
echo "<pre>";
$this->agent_model->insert_batch($agents);
$this->property_model->insert_batch($properties);
die;
agent_model
public function insert_batch($data) {
print_r($data);//$this->tbl = agent
return $this->db->insert_batch($this->tbl, $data);
}
property_model
public function insert_batch($data) {
print_r($data);//$this->tbl = properties
return $this->db->insert_batch($this->tbl, $data);
}
I expect the output will be inserted value in bulk but the output is simply
Array ( [0] => Array ( [agent_bio] => [agent_address] => [agent_email] => [agent_twitter] => [agent_facebook] => [image] => [agent_office_address] => [created_at] => [agent_code] => BB815843 [agent_name] => Anthony Bruno [agent_phone] => (781) 710-4544 [agent_office_code] => BB5918 [agent_office_name] => Gibson Sotheby's International Realty [agent_office_phone] => (617) 426-6900 ) ) Array ( [0] => Array ( [id] => [name] => [bed] => [vehicle] => [bath] => [rate] => 2500000.00 [view_count] => [source] => mls [type] => sell [msl_id] => 72485384 [is_featured] => [banner_image] => [country_id] => 1 [city] => Somerville, MA [street] => Beacon Street [zip_code] => 02143 [is_beachfront] => No [area] => [lat] => [lon] => [has_basement] => [direction] => 294 Beacon Street is between Eustis Street and Sacramento Street [has_master_bath] => [rooms] => [property_type] => [status] => ACT [taxes] => 0.00 [tax_year] => 00 [year_build] => [list_date] => 04/22/2019 [agent_id] => [tags] => [raw_data] => {"ACRE":"0.17","AMENITIES_LD":"Public Transportation, Shopping, Park, T-Station, University","BEACHFRONT_FLAG":"No","BUYER_BROKER_COMP":"2","CABLE_AVAILABLE_LD":"Yes","COMP_BASED_ON":"Net Sale Price","DIRECTION":"294 Beacon Street is between Eustis Street and Sacramento Street","DISCLOSURE":"No","DISCLOSURES":"See plans and environmental site assessment attached to MLS listing.","DOCUMENTS_ON_FILE_LD":"Other (See Remarks)","DPR_Flag":"No","ELECTRIC_FEATURE_LD":"On-Site","ENTRY_ONLY":"No","FIRM_RMK1":"See plans and environmental site assessment attached to MLS listing.","GAS_LD":"On-Site","HOW_SHOWN_BB":"Call List Agent, Accompanied Showings, Appointment Required","HOW_SHOWN_FB":"Call List Agent, Accompanied Showings, Appointment Required","LAND_DESC_LD":"Level","LD_TYPE_LD":"Residential","LENDER_OWNED":"No","LIST_AGENT":"BB815843","LIST_AGENT_NAME":"Anthony Bruno","LIST_AGENT_PHONE":"(781) 710-4544","LIST_DATE":"04/22/2019","LIST_DATE_RCVD":"4/22/2019 9:45:00 AM","LIST_OFFICE":"BB5918","LIST_OFFICE_NAME":"Gibson Sotheby's International Realty","LIST_OFFICE_PHONE":"(617) 426-6900","LIST_PRICE":"2500000.00","LISTING_AGREEMENT":"Exclusive Right to Sell","LIST_NO":"72485384","LOT_SIZE":"7535.00","MAIN_LO":"BB5918","MARKET_TIME":"28","MARKET_TIME_BROKER":"28","MARKET_TIME_PROPERTY":"28","ORIG_PRICE":"2500000.00","PHOTO_DATE":"4/22/2019 9:45:00 AM","PROP_TYPE":"LD","REMARKS":"Fully approved! This is your chance to purchase one of the last buildable lots on Beacon Street in Somerville. Ideally located on the Somerville/Cambridge line just a short walk to the MBTA Red Line at Porter Square and in close proximity to both Harvard Square and Inman Square. Current plans call for the following: 7 parking spaces (6 garage, 1 outdoor), 5 units total. Unit breakdown as follows: 2 two level townhouse style units, 1,800 sq/ft each, 2 bed/2.5 bath. 2 one bedroom units, 900 sq/ft each,1 bed/1 or 1.5 bath, 1 penthouse unit, 1,600 sq/ft (attached plans list this unit at 1,344 sq/ft, but the seller is increasing the living space), 2 bed/2.5 bath with private 30x8 (240 sq/ft) balcony. 1,000 sq/ft common outdoor space (garden/patio). Gas and electric already on site about 20 feet away. Sewer already on site about 30 feet away. 5 inch fire line and 2 inch cold water line not on site.","ROAD_TYPE_LD":"Public, Paved, Publicly Maint., Sidewalk","SEWER_LD":"Public, On-Site","SHORT_SALE_LENDER_APP_REQD":"No","SHOW_INSTRUCTION":"Contact Anthony Bruno at 781 710 4544 or [email protected]","STATUS":"ACT","STATUS_DATE":"4/22/2019 9:45:00 AM","STREET_NAME":"Beacon Street","STREET_NUM":"294","TAX_YEAR":"00","TAXES":"0.00","TOWN":"Somerville, MA","UPDATE_DATE":"4/26/2019 3:05:00 AM","WATER_LD":"At Street","WATERFRONT_FLAG":"No","WATERVIEW_FLAG":"No","ZIP_CODE":"02143","ZONE_USAGE_LD":"Other (See Remarks)","ZONING":"RC"} [created_at] => [description] => Fully approved! This is your chance to purchase one of the last buildable lots on Beacon Street in Somerville. Ideally located on the Somerville/Cambridge line just a short walk to the MBTA Red Line at Porter Square and in close proximity to both Harvard Square and Inman Square. Current plans call for the following: 7 parking spaces (6 garage, 1 outdoor), 5 units total. Unit breakdown as follows: 2 two level townhouse style units, 1,800 sq/ft each, 2 bed/2.5 bath. 2 one bedroom units, 900 sq/ft each,1 bed/1 or 1.5 bath, 1 penthouse unit, 1,600 sq/ft (attached plans list this unit at 1,344 sq/ft, but the seller is increasing the living space), 2 bed/2.5 bath with private 30x8 (240 sq/ft) balcony. 1,000 sq/ft common outdoor space (garden/patio). Gas and electric already on site about 20 feet away. Sewer already on site about 30 feet away. 5 inch fire line and 2 inch cold water line not on site. ) )
2
Answers
Thank you for your help guys.. I figured out the problem
$this->db->trans_start();
was being using in the somewhere beginning of the function and I was usingdie()
before$this->db->trans_complete();
Sorry for silly troubleTry this and check your query…check this line specially – “Gibson Sotheby’s International Realty”