Jump to content

Make all database rows lowercase with a capital


eits

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 ;))

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.