Please help me |
[eluser]saymes[/eluser]
When i enter the data to the base With the following Code : $data = array( 'title' => $title , 'from_main_section' => '0' ); $this->db->insert('section', $data); its Giving me an error : A Database Error Occurred Error Number: 1048 Column 'from_main_section' cannot be null INSERT INTO `myforum_section` (`title`, `from_main_section`) VALUES ('test forum', NULL) I want value to be 0 not NULL Please help me and Thank you
[eluser]saymes[/eluser]
Im programing a forum by codeigniter Arabic http://upload.traidnt.net/upfiles/kC181412.jpg English http://upload.traidnt.net/upfiles/uXx81369.jpg
[eluser]saymes[/eluser]
I Will change the style later so Please help me With My problem
[eluser]John_Betong[/eluser]
Please use CODE options to wrap your code. Code: $data = array I modified your code to suit my database, tables and fields and the insertion worked fine. I also had to change the backticks to single quoation marks. Have you: 1. loaded the database correctly? 2. Do you have other SQL statements that are working correctly? 3. Do either title or from_main_section have unique indexes 4. Have you manually tried using the SQL statement in PhpMyAdmin?
[eluser]pickupman[/eluser]
[quote author="noctrum" date="1283276778"]'0' is not 0...[/quote] Exactly, with quotes that becomes a string and not bool/null. |
Welcome Guest, Not a member yet? Register Sign In |