I was wondering how to make my MySQL entries auto-cap. :X) I'm pretty sure it's super-simple but I don't even know what to search for in Google.
I basically want it to be able to cap everyone's name instantly. It's also be nice if I could stop users from having ANNOYING NAMES IN CAPS too but that's a minor issue.
MySQL... uhm. Naming
Moderator: General Moderators
I'm not sure I know what you're asking. Are you trying to have the username field appear in all caps? if that is the case, just capitalize it right before outputting it...
Code: Select all
<?php
// ... get mysql row ...
$name = $mysql_row['username'];
echo strtoupper($name);
// ... do some other stuff ...
?>-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Err, no, it's more of a server-side thing. Like, no matter what the user enters in the field,
bObErInO = Boberino
Regardless of capitalization.
I guess I could do it with PHP, but I was looking for more of a mysql-table sorta thing. Like how you could technically not have to use auto_increment, but you can also just use it.
bObErInO = Boberino
Regardless of capitalization.
I guess I could do it with PHP, but I was looking for more of a mysql-table sorta thing. Like how you could technically not have to use auto_increment, but you can also just use it.
You could always use MySQL's UPPER/UCASE built in function so like uhmm
Code: Select all
SELECT * from my_table_of_awesome_random_cased_words WHERE UCASE(word)=UCASE('myWordIwAnTToSearChTheETabLeFor')
If it's about the latin charset, easy:
Code: Select all
$name = ucfirst(strtolower($name));-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am