A Database Error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: A Database Error (/showthread.php?tid=12363) |
A Database Error - El Forum - 10-16-2008 [eluser]umefarooq[/eluser] Hi im inserting data in table it gives me following error Quote:A Database Error Occurred where id is primary key when i comment var id from model it insert the data but key is always 0. A Database Error - El Forum - 10-16-2008 [eluser]Derek Allard[/eluser] Do you want to set that column to auto-increment? A Database Error - El Forum - 10-16-2008 [eluser]umefarooq[/eluser] ya id column is primary key and also auto increment but i dont know what and where is problem because first time im using CI and i want to carry on for my rest of projects. by reading the user manual its look nice. A Database Error - El Forum - 10-16-2008 [eluser]Derek Allard[/eluser] What does your insert code look like? A Database Error - El Forum - 10-16-2008 [eluser]umefarooq[/eluser] here is my model code Code: class FormModel extends Model { A Database Error - El Forum - 10-16-2008 [eluser]Derek Allard[/eluser] And your id is set to autoincrement? Are you sure? Could you add Code: echo $this->db->last_query(); A Database Error - El Forum - 10-16-2008 [eluser]umefarooq[/eluser] with this model when i want to insert the data it give me error Column ‘id’ cannot be null but when i comment the var id than it insert the data but id is 0 always. A Database Error - El Forum - 10-16-2008 [eluser]Derek Allard[/eluser] And your id is set to autoincrement? Are you sure? Could you add Code: echo $this->db->last_query(); A Database Error - El Forum - 10-16-2008 [eluser]Seppo[/eluser] I'll ask two questions, if you don't mind... Can you run "DESCRIBE flipp_settings" and post the results? Are you using MySQL or other DB engine? |