Problem retrieving rows |
[eluser]Unknown[/eluser]
I am writing a simple site to get familiar with Code Igniter. I am at the first step of getting a simple user login going. When I try to retrieve data from the database, I get a Windows dialog saying "Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience." Here is what I have so far: My User model: Code: <?php The freeze occurs at $row = $query->first_row("array");. I have tried $query->result(), $query->result_array() and $query->first_row() (without array). The same thing happens on all of them. I logged the SQL and the statement generated is correct and when I use it directly in the database it works properly. Here is the SQL: Code: SQL = SELECT * FROM (`user`) WHERE `email` = '[email protected]' AND `password` = 'test' Code: +------+---------------+----------+ When I do a print_r() on the $query object it shows that 1 row is supposed to be there, but there is no data: Code: query = CI_DB_mysqli_result Object And one more thing. Here is what I see in the event viewer: Code: Faulting application httpd.exe, version 2.2.9.0, faulting module php_mysqli.dll, version 5.2.6.6, fault address 0x00002beb. If anyone has eny ideas, I would appreciate it. Thanks.
[eluser]Mat-Moo[/eluser]
Code: $user = new User(); Code: if ($query->num_rows() > 0) {
[eluser]Unknown[/eluser]
Thanks for your reply. I had it your way first and changed it as something to try and fix the problem. Now on one computer I am using it works fine, but it still doesn't work on the other one. It's a very strange problem. I even tried rebooting the machine and it still didn't work. When I write the access code myself it works fine. So it is either a bug in Code Igniter or a problem in the way I am using it.
[eluser]Mat-Moo[/eluser]
I think if this was a CI bug there would be lot of people with issues as your doing pretty basic stuff. Have both systems got the latest version of CI? Are you running any .htaccess files? |
Welcome Guest, Not a member yet? Register Sign In |