• Advertisement
Sign in to follow this  

very strange bug with MySQL database

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, im working on a 2d online RPG. anyway, my account creation was working yesterday but last night while working on it more i must have broken it. the bug is very strange... if i create a new account via the game, i can do a query from an SQL prompt "select * from T_AC_ACCOUTS", it shows a list of all the accounts, and the account that i just created is listed there... however, when i do "select * from T_AC_ACCOUNTS where USERNAME = 'user'", where 'user' is the name i just created, it returns 0 results! now, the weird part is, this only happends if i create the account via the game. if i make the account via an SQL prompt by just typing in an insert statement, this bug doesn't happen. this doesnt make sence.. heres an image of me doing the first query: note theres a few accounts here. one named "gfilla", which i created through the SQL prompt. another named "gfill" which i made through the game. now, if i do a query for the "gfilla", i get back 1 result like i should: however, if i query for "gfill", i get 0 results! how is this even possible? i mean, looking at the first image the username is clearly in the database. so why wont this query work? thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
gfill != gfilla

Look at the LIKE predicate if you want to do partial names like that.

Share this post


Link to post
Share on other sites
hi C-Junky,

wow, that was a fast reply [smile]. sorry but i think you misunderstood my problem. if you look at the first image, there are 2 accounts in the database, one named "gfilla", and another named "gfill". query'ing for the former will return the account, but for the latter it doesn't. it just doesn't make sence...

thanks for anymore help.

Share this post


Link to post
Share on other sites
"gfil" has a space or something in front of it - Look closely at your screenshot. Your app probably forgot to trim the whitespace from the username or something.

Share this post


Link to post
Share on other sites
In the image listing the accounts it looks like there is a space in front of the gfill account name? It doesn't appear the letters gfilla line up with those in gfill.

Share this post


Link to post
Share on other sites
On the first screen dump it looks like there is a space before the username created in program. If this is the case, it will explain your mysterious bug! 'gfill' is different to ' gfill'...

Share this post


Link to post
Share on other sites
wow, thanks guys... when i made some changed last night i accidently put an extra whitespace in the query, which explains why the problem only happend w/ accounts created with my game.

thanks again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement