codeigniter Disallowed Key Characters error

slore

New Member
Im trying to have a form submit to a controller were it is then inserted into a database. It worked for the past couple days but apparently i accidentally changed something because it "randomly" doesn't work. Any help would be appreciated as i couldn't figure it out after searching online. Thanks!PHP \[code\] public function houses () {if ($this->input->post()) { $bedrooms = $this->input->post('bedrooms'); $bathrooms = $this->input->post('bathrooms'); $street = $this->input->post('street'); $house_number = $this->input->post('house_number'); $basement = $this->input->post('basement'); $garage = $this->input->post('garage'); $fence = $this->input->post('fence'); $query = $this->db->query('INSERT INTO houses VALUES (NULL, "'. $bedrooms.'","'.$bathrooms.'","'.$house_number.'","'. $street.'","'.$basement.'","'.$garage.'","'.$fence.'")');}$query = $this->db->query("SELECT * FROM houses");foreach($query->result() as $row) { $data['bedrooms'] = $row->bedrooms; $data['bathrooms'] = $row->bathrooms; $data['house_number'] = $row->house_number; $data['street'] = $row->street; $data['garage'] = $row->garage; $data['basement'] = $row->basement; $data['fence'] = $row->fence; $data['id'] = $row->id; $this->data['houses'][] = $data;}$title = 'Houses';$this->data['title'] = $title;$this->template->add_css('css/dog.css');$this->template->write_view('content', 'houses', $this->data);$this->template->render(); }\[/code\]HTML \[code\]<form method='post' action='<?php site_url('welcome/houses')?>'> <li><span>Bedrooms</span> <input type="text" name="be stdClass::$emaildrooms" /></li> <li><span>Bathrooms</span> <input type="text" name="bathrooms" /></li> <li><span>House Number</span> <input type="text" name="house_number" /></li> <li><span>Street</span> <input type="text" name="street" /></li> <li> <span>Basement</span> <select name="basement"> <option>Yes</option> <option>No</option> </select><br/> </li> <li> <span>Garage</span> <select name="garage"> <option>Yes</option> <option>No</option> </select><br/> </li> <li> <span>Fence</span> <select name="fence"> <option>Yes</option> <option>No</option> </select><br/> </li> <input type="submit" name="Submit" /></form>\[/code\]
 
Back
Top