• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Mysql help

Bug

New Member
Joined
Jan 7, 2011
Messages
111
Reaction score
1
Is there a mysql query to find all characters in database with names like tESt teTst TsTe, with capital letters in their name
ty
 
Hi Bug,

A php routine to rename all players so that it capitalised the first letter of each word in their name while making the rest of the word lower case would be:


php code to do that would be (you have to use your own mysql db connection routine):
PHP:
<?PHP
  $query = "SELECT * FROM `players`";
  $result = mysql_query($query);
  while ($row = mysql_fetch_array($result) {
    $oldName = $row['name'];
    $playerId = $row['id'];
    $newName = ucwords(strtolower($oldName));
    $updateQuery = "UPDATE `players` SET `name` = '$newName' WHERE `id` = '$playerId'";
    $updateResult = mysql_query($updateQuery);
  }
?>
 
Back
Top