Web Hosting Talk







View Full Version : Upper case


Mondeo
04-14-2005, 04:42 AM
I have a MySQL database with about 1000 customers in it and their details are entered as differing cases - some are in perfect "sentence" case (ie first letter capitalised), some are in upper case but a lot are in lower case which causes a problem for me when it comes to posting goods to them as the postal code in particular needs ideally to be in upper case.

I had a look through PHP.net and seached on the net and found references to some functions like upper, strtoupper and ucwords but I cant get them to work for new entries let alone even knowing where to begin to convert all the existing records.

Does anyone know a way of converting all the existing entries to upper case or sentence case without having to manually change them? Also how can I make it so when a user enters data or changes their details that the fields are entered or changed in the database as upper case?

TIA

Jay

Mondeo
04-14-2005, 05:29 AM
Never mind! Sorted it - used ucwords(strtoupper()) in my labelling application to force it to print the all labels in upper case regardless of how they were entered :)