Welcome Guest, Not a member yet? Register   Sign In
Simple query question
#8

[eluser]markanderson993[/eluser]
Here is the error I am receiving:

Quote:A Database Error Occurred

Error Number: 1064

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 'anderma'' and `password` = md5(concat(md5(''my_password''), sal' at line 4

SELECT * FROM `user` WHERE `user_name` = ''anderma'' and `my_password` = md5(concat(md5(''my_password''), salt))

And here is the code I am using

Code:
$second_verify = $this->CI->db->query("
                SELECT *
                FROM `user`
                WHERE
                    `user_name` = '" . $this->CI->db->escape($username_login) . "' and
                    `password` = md5(concat(md5('" . $this->CI->db->escape($password_login) . "'), salt))
            ");

Here is the code that follows this:

Code:
if ( (($query != null) && ($query->num_rows() == 0)) OR (($second_verify != null) && ($second_verify->num_rows() == 0)))
            {
                //we didn't find the password
                $pass_cond = FALSE;
                //debugging
                //echo '<br>password not found<br>';
            }
            else
            {
                //we found the password
                $pass_cond = TRUE;
                //debugging
                //echo '<br>password found<br>';
            }
        }

...


Messages In This Thread
Simple query question - by El Forum - 02-17-2009, 07:16 PM
Simple query question - by El Forum - 02-17-2009, 07:37 PM
Simple query question - by El Forum - 02-17-2009, 07:39 PM
Simple query question - by El Forum - 02-17-2009, 07:40 PM
Simple query question - by El Forum - 02-17-2009, 07:43 PM
Simple query question - by El Forum - 02-17-2009, 07:45 PM
Simple query question - by El Forum - 02-17-2009, 07:48 PM
Simple query question - by El Forum - 02-17-2009, 07:50 PM
Simple query question - by El Forum - 02-17-2009, 07:56 PM
Simple query question - by El Forum - 02-17-2009, 08:00 PM
Simple query question - by El Forum - 02-17-2009, 08:01 PM
Simple query question - by El Forum - 02-17-2009, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB