Simple query question |
[eluser]markanderson993[/eluser]
Hello there codeigniter experts! I have a small and simple question. I am entering this code Code: $second_verify = $this->CI->db->query(" And I keep getting this error: Quote:A Database Error Occurred I know the solution must be incredibly simple but I just can't figure it out! Does anyone have any ideas? Any help would be greatly appreciated! Thank you! - Pianoman993
[eluser]TheFuzzy0ne[/eluser]
I'd try escaping it differently: Code: $second_verify = $this->CI->db->query(" You may find something along those lines might work better.
[eluser]TheFuzzy0ne[/eluser]
Or you can use Query Bindings. http://ellislab.com/codeigniter/user-gui...eries.html
[eluser]markanderson993[/eluser]
Thanks for your speedy reply. I tried this Code: $second_verify = $this->CI->db->query(" But now I get this error message Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''user' WHERE 'user_name' = 'anderma' and ' at line 2
[eluser]TheFuzzy0ne[/eluser]
You are using single 'quotes' for escaping fields and table names, when you need to use `backticks`.
[eluser]markanderson993[/eluser]
Alrighty, I'll revert back to how you originally had revised my code. But even when I tried that I was getting the same error. :/
[eluser]TheFuzzy0ne[/eluser]
Please repost the code you're using, and the exact error your now receiving. If you used my code, the original error should now be gone.
[eluser]markanderson993[/eluser]
Here is the error I am receiving: Quote:A Database Error Occurred And here is the code I am using Code: $second_verify = $this->CI->db->query(" Here is the code that follows this: Code: if ( (($query != null) && ($query->num_rows() == 0)) OR (($second_verify != null) && ($second_verify->num_rows() == 0)))
[eluser]TheFuzzy0ne[/eluser]
OK, that's a different error message. Try this function. I have a feeling I shouldn't have used quotes inside the md5 function: Code: $second_verify = $this->CI->db->query("
[eluser]markanderson993[/eluser]
I appreciate all your help so far, I hate to be so troublesome but I am still getting the same error message. Frustrating! Quote:A Database Error Occurred |
Welcome Guest, Not a member yet? Register Sign In |