PDA

View Full Version : Wth is wrong with this?



Agnostic Bear
03-05-2007, 09:56 AM
I have an sql query, and I can find _NOTHING_ wrong with it:


SELECT * FROM `users` WHERE `username` = 'Dan' AND `password` = 'LiTkJ6hnGbvNc'

SQL Error:

Line: 486
File: /home/enumeric/public_html/live/inc/class_core.php
Error: 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 ''Dan' AND `password` = 'LiTkJ6hnGbvNc'' at line 1
SQL Passed: SELECT * FROM `users` WHERE `username` = 'Dan' AND `password` = 'LiTkJ6hnGbvNc'

Function called:


function sql_query( $query ) // Simple holdall for mysql queries + err.
{
$query = $this->clean( $query, 2 );
$query = str_replace( "[apos]", "'", $query );
return @mysql_query( $query ) // Query will _only_ be cleaned at level 2. (NO HIGHER!)
or exit( "<strong>Line:</strong> " . __LINE__ . "<br /><strong>File:</strong> " . __FILE__ . "<br /><strong>Error: </strong>" . mysql_error() . "<br /><strong>SQL Passed: </strong>$query" );
}


-_-'

Want to hide these adverts? Register an account for free!