MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 20th, 2005, 09:58 AM
CobraTi CobraTi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 8 CobraTi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 57 m 13 sec
Reputation Power: 0
MySQL not returning results

I've imported a CSV file into MySQL using the PHPMyAdmin web interface. The table holds customer account information (username, password, etc).

When I do a SELECT * FROM accounts, it returns all the results.

When I SELECT * FROM accounts WHERE username LIKE *first half of a username* it will return results that match.

But when I SELECT * FROM accounts WHERE username=*someones full username*, it will not return the information.

Does anyone have any idea why? If I enter a record in by hand through PHPMyAdmin, I can do the username=*whatever* and it finds the correct user. Its only when I try to search a record that was imported from the CSV file. Thanks for any help.

Reply With Quote
  #2  
Old October 20th, 2005, 10:12 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
Check that there aren't any extra characters or spaces that were inserted during your import. If you've got 'bob ' in your db, and you search for 'bob', you're going to come up empty. If you do have extra characters, you can use TRIM() to get rid of them.
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
  #3  
Old October 20th, 2005, 10:38 AM
CobraTi CobraTi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 8 CobraTi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 57 m 13 sec
Reputation Power: 0
Thanks for that advice. There are spaces at the end of every field. Is there a way to use TRIM when I'm importing the data? Even when I do my query with the space, it still doesn't return the result (ex: SELECT * FROM `accounts` WHERE `username`='johnt25090011 ').

What I'm doing is creating a website with PHP and MySQL so that the customers can log on. Whenever I try to log someone in though, it won't. I've tried putting their username/pass in with and without the space at the end and neither way lets me log in.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL not returning results


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway