0

Hi,

I am looking for some information about using Underscores ( _ ) in usernames. I currently have a friends system where a user can become friends with another user and this is placed into a database.

I then have a query to display all of the users friends, which works totally fine, unless the user has an underscore in their name. It does not matter where it lays my programme does not like it for example:

_AdriftUniform
Adrift_Uniform
AdriftUniform_

None of these examples will be picked up on, but any username without an underscore will work fine.

The annoying thing is that names with underscores will work everywhere else in the website weather it is echoing the username, using it in the url or saving it in a database along side an uploaded image, Just not with my friends system.

I hope someone can help me understand why this is not working. I am available to show code is needs be.

Thanks,
AdfirtUniform.

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by AdriftUniform
0

Have you tried replacing the underscores with its html entity code?
In this case underscore is:

& # 9 5 ;

(without the spaces) See here
Might be worth a try...

Edited by nonshatter: n/a

0

I have not tried this no, but I do not know how I would implement it as the Usernames are User generated. I cant really ask the users to type & # 9 5 ; instead of an underscore.

Any ideas of how I can convert it before it goes into the database perhaps?

Edited by AdriftUniform: n/a

0

The annoying thing is that names with underscores will work everywhere else in the website weather it is echoing the username, using it in the url or saving it in a database along side an uploaded image, just not with my friends system.

This should tell you already that the problem lies within the friends system. Anyway, it would be hard to locate the problem without code.

0

This problem is fixed now, I have no idea how it is fixed, I just began work on this the next day and all of a sudden it was working. Very strange!

Thanks for all your help guys.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.