[SOLVED]Query OK but still error?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

UrButtFullOfArr0ws
Forum Commoner
Posts: 64
Joined: Wed Feb 21, 2007 11:42 am
Location: Up a tree >.>"

Post by UrButtFullOfArr0ws »

# result for "SELECT * FROM `accounts` WHERE `email` = 'b@b.com' AND `pass` = '1'": 0
Hmm...weird...it says i don't have any rows corresponding to that query when i know there's a row which contains b@b.com and 1 :?
So query is ok but, MySQL doesn't send back the data?

Thx.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

UrButtFullOfArr0ws wrote:when i know there's a row which contains b@b.com and 1 :?
So query is ok but, MySQL doesn't send back the data?
It's more likely that there is no record having `email` = 'b@b.com' AND `pass` = '1'. May be as simple as a space or newline character you haven't noticed.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Provide the result for:

Code: Select all

SELECT * FROM `accounts`;
Including field header (or the field names).
UrButtFullOfArr0ws
Forum Commoner
Posts: 64
Joined: Wed Feb 21, 2007 11:42 am
Location: Up a tree >.>"

Post by UrButtFullOfArr0ws »

This is soooo embarassing... :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops: :oops:
when i wanted to mark the results for the mysql query i noticed the password was 1234 not 1 :( :( becouse i entered a 4 letter requirement for the password through another registration form. I remembered i entered the first one manually and i entered 1...it looks like i was wrong... The problem however is solved now...first time i tried it didn't work with the correct pass either :?
Sorry :( :oops:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Its all good.

For future reference it is a good idea to echo our your SQL (in development of course, not production) so you can easily drop the SQL into your SQL administrator and see if you are actually getting back what you expect. In this case it would have saved you about a page and a half worth of posts. :wink:
Post Reply