Jump to content

Make all database rows lowercase with a capital


Recommended Posts

Hello!

 

I was wondering if it is possible to do the following with a PHP script (I am new to PHP). I have a database with customer information but all the company names are in capitals. Is it easy to somehow convert all of these to lowercase but with a capitalised letter for the first letter of each word.

 

so 'BOBBYS BITS AND PIECES'

 

becomes 'Bobbys Bits And Pieces'.

 

Thanks in advance!

 

no SQL statements to update them with that!..

your need to create a script that loop throught each record and update it.

 

basic idea

1. connection #1, select *

2. loop though each records (start)

3. $data = ucwords(strtolower($c1row['data']));

4. connection #2 update table set data='$data' where ID={$c1row['id']}

5. end loop

 

 

sorry (i'm at work so had to be quick ;))

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.