No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I use codeigniter3.0.0 version, when i run the project i get this error plz tell me how i fix this error. Error Number: 1048 Column 'no_of_people' cannot be null INSERT INTO reservation (no_of_people) VALUES (NULL) Filename: C:/xampp/htdocs/book/application/models/Books_model.php Line Number: 26 My model code is class Books_model extends CI_Model{ public function … |
|
its my model <?php class Books_model extends CI_Model{ public function __construct(){ $this->load->database(); } public function get_restaurants() { $sql = "SELECT id, names FROM restaurants "; $query = $this->db->query( $sql ); return $query->result(); } } and controller code is <?php class Booking_Controller extends CI_Controller{ public function __construct(){ parent::__construct(); $this->load->model('Books_model'); } public … |
|
In Codeigniter, how we handle many to many relationship between table....how we handle the pivot table? |
|
Restaurant | restaurant_id | names | Date | date_id | date | Time_slots | time_slots_id | start_time | end_time | restaurant_id | date_id | Reservations | reservation_id | No.of.people | time_slots_id| Relations between tables: Relation between time slots and restaurants = Many to Many Relation between time slots and date … |
|
Its my controller code <?php class Booking_Controller extends CI_Controller{ public function __construct(){ parent::__construct(); $this->load->model('Books_model'); } This is my model code <?php class Books_model extends CI_Model{ public function __construct(){ $this->load->database(); } public function get_restaurants() { $sql = "SELECT id, names FROM restaurants "; $query = $this->db->query( $sql ); return $query->result(); } … |