[SOLVED]Query OK but still error?
Posted: Wed Feb 21, 2007 1:37 pm
The Ninja Space Goat | Please use
The query in PHP is this:
So the outcome would be (if username is a@a.com and password 1):
select * from accounts where email = 'a@a.com' and pass = '1'
What the query obviously does is it looks whether there is a data row in the db with that email and pass (if he is registered AND if the pass corresponds to the email)
Any suggestions?
Thx in advance.
The Ninja Space Goat | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I get the following error:
Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 2 (or the query data is unbuffered)
mysql_data_seek is used in a function (made not by me, found on php.net) which i know 500% that it works for other queries:Code: Select all
function mysql_fetch_all($result) {
$return = array();
mysql_data_seek($result, 0);
while ($row = mysql_fetch_assoc($result)) {
$return[] = $row;
}
return $return;
}Code: Select all
"select * from accounts where email = '" . mysql_real_escape_string($_POST['email']) . "' and pass = '" . mysql_real_escape_string($_POST['pass']) . "'"select * from accounts where email = 'a@a.com' and pass = '1'
What the query obviously does is it looks whether there is a data row in the db with that email and pass (if he is registered AND if the pass corresponds to the email)
Any suggestions?
Thx in advance.
The Ninja Space Goat | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]