RE: [PHP-DB] RE: [tcphp] Hella fun project I'm about to throw at some tech college students

From: Date: Mon, 03 May 2004 01:24:58 +0000
Subject: RE: [PHP-DB] RE: [tcphp] Hella fun project I'm about to throw at some tech college students
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34245@lists.php.net to get a copy of this message
Hi If the reformating is complex - ABVDFR Co is in the middle of the field - then php $bits = explode (" ", $FieldValue ) ; then each element of $bits is a word, making reworking it easier Just my 2p worth :) Peter > -----Original Message----- > From: Rafi Sheikh [mailto:Rafi.Sheikh@Ingenix.com] > Sent: 03 May 2004 02:17 > To: talk@tcphp.org; php-db@lists.php.net; talk@lists.nyphp.org > Subject: [PHP-DB] RE: [tcphp] Hella fun project I'm about to throw at > some tech college students > > > Hi List. A quick question. I have some categories that are really long > and I would like to re-word or re-format them when I am bring > data in from a > DB. Now which would be better: > > Do it with PHP > or > Do it with MySQL > > Any suggestions as to how to? > > Example: > A column name: Customer --> VARCHAR > Values in Customer: "USA-North Upper ABVDFR Co. and Sons" > > I would like to re-word it for example: ABVDFR Co. > > I know I could use SUBSTRING or MID, or replace but the issue is since the > column is a VARCHAR, the length of the value may change from row > to row, for > example: one row it maybe 20, in the next 13 and so on so forth. I also > thought that if I could use a length statement and come up with a > formula...but so far no success....any suggestions? > > Thx in Adv. > > RS > > > This e-mail, including attachments, may include confidential and/or > proprietary information, and may be used only by the person or entity to > which it is addressed. If the reader of this e-mail is not the intended > recipient or his or her authorized agent, the reader is hereby > notified that > any dissemination, distribution or copying of this e-mail is > prohibited. If > you have received this e-mail in error, please notify the sender > by replying > to this message and delete this e-mail immediately. > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#34245) next »