Problem with MsSQL query |
[eluser]rainzzz[/eluser]
I'm creating a register form and my controller is Code: if($this->form_validation->run() == TRUE) and my user_model Code: function add_user($data_add) and last when running query I get this error Quote:Error Number: 37000 another issue is when I use $this->db->get('statement') and I always get the syntax error like above. Need to be helped, thanks so much !
[eluser]Tim Brownlaw[/eluser]
Hi rainzzz, First of all I'm not a mssql user so I've not got the setup to replicate this... From the Error Message it's showing the SQL is messed up. It's stating that it's seeing INSERT INTO (Account_Info cAccName, cPassWord, cEmail, cPhone) VALUES (‘John’, ‘e10adc3949ba59abbe56e057f20f883e’, ‘jogzz@yahoo.com’, ‘123456789’) Which will cause it to go into a spin! When the insert should be creating... INSERT INTO `Account_Info` ('cAccName', 'cPassWord', 'cEmail', 'cPhone') VALUES (‘John’, ‘e10adc3949ba59abbe56e057f20f883e’, ‘jogzz@yahoo.com’, ‘123456789’) I can't see anything wrong in the provided code for your Controller / Model unless I'm missing something. Is the $this->db->get('Account_Info') displaying the same messed up SQL in the Error? So apart from being bleeding obvious as to what it's complaining about, I'm afraid I'm falling short as to Why! Which version of CI are you using? Cheers
[eluser]rainzzz[/eluser]
Hi Tim Brownlaw ! Firts ! Thank you in advanced ! I'm using lastest CI version. And I'm a beginner in CI. My project need to use mssql. This also the first time I do it. I'm so sorry because my missing operator in question. So I've just modified. I meant when we use active reocord when adding data to a table the SQL Server return wrong syntax. Here is most simple examle Code: $query = $this->db->get('Account_Info'); SQL Server return Quote:Error Number: 37000 It seem not good with the quote on Account_Info, and SQL Server doesn't accept Use this whill be OK ! Code: $query = $this->db->query('SELECT * FROM Account_Info'); Is anybody know what wrong with it ??? |
Welcome Guest, Not a member yet? Register Sign In |