$idgen = uniqid(rand(), false);
$churchName = $this->input->post('church_name');
$streetAddress = $this->input->post('street_address');
$locationalCity = $this->input->post('locational_city');
$locationalState = $this->input->post('locational_state');
$locationalZip = $this->input->post('locational_zip');
$locationalCountry = $this->input->post('locational_country');
$taxNum = $this->input->post('tax_exemption_number');**
$this->db->query("INSERT INTO church_repo (church_name, street_address, locational_address, locational_zip, locational_country, locational_city, overseer_account_id, tax_exemption_number, status) VALUES('{$churchName}', '{$streetAddress}', '{$locationalCity}', '{$idgen}', '{$locationalState}', '{$locationalZip}', '{$locationalCountry}', '{$taxNum}', 'pending')");
上面的代碼沒有被正確插入,在詞,我發現了以下錯誤:笨不能正確插入SQL數據
Error Number: 1054
Unknown column 'locational_address' in 'field list'
INSERT INTO church_repo (church_name, street_address, locational_address, locational_zip, locational_country, locational_city, overseer_account_id, tax_exemption_number, status) VALUES('bgtg', 'ff', 'rgfr', '270284f1eec6e5bfd4', 'rgrd', 'bdtbdt', 'United States of America', '84894894894', 'pending')
Filename: C:\Workspace\htdocs\Jan-2012\Gospel-links.org\system\database\DB_driver.php
Line Number: 330
'street_address'是不存在的..謝謝你。順便說一句,你怎麼知道這是'street_address'? –
@MichaelGrigsby你分配的變量看起來像你的表cols($ churchName,$ locationalCity ..)相同的名稱(camelCased),這是一個「找到差異」的遊戲:) –