RE: [PHP-DB] dropping one word from column entries
| From: | Beau Lebens | Date: | Thu, 30 May 2002 01:11:28 +0000 |
| Subject: | RE: [PHP-DB] dropping one word from column entries | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19510@lists.php.net to get a copy of this message | ||
A cleaner option might be to do this before you get it to PHP at all, via
your SQL query.
Check out the string functions available, there are a number of
substring-style things available, string position etc.
HTH
Beau
// -----Original Message-----
// From: Ed Gorski [mailto:gorskie@spjc.edu]
// Sent: Thursday, 30 May 2002 12:09 AM
// To: Jen Swofford; php-db@lists. php. net
// Subject: Re: [PHP-DB] dropping one word from column entries
//
//
// use:
//
// $name="Mouse Housing Products";
// $name=str_replace("Products","",$name);
//
// also the RTFM() function works too
//
// ed
//
// At 11:06 AM 5/29/2002 -0500, Jen Swofford wrote:
// >I'm having a problem with this and suppose I'm looking for
// a handout. :|
// >
// >I am displaying names of product categories. The names of
// the categories
// >are:
// >
// >Bird Cages
// >Cat Toys
// >Chinchilla Housing Products
// >Dog Leashes
// >Ferret Housing Products
// >Mouse Housing Products
// >
// >What I want to do when displaying the names is to drop
// "Products" whenever
// >it appears. What I want do display on the page instead is:
// >
// >Bird Cages
// >Cat Toys
// >Chinchilla Housing
// >Dog Leashes
// >Ferret Housing
// >Mouse Housing
// >
// >And no, changing the names of the categories in the
// database is not an
// >option. :) I'm completely missing the boat on this one...
// any help?
// >
// >Jen Swofford
// >jen@littleduck.com
// >
// >
// >
// >
// >--
// >PHP Database Mailing List (http://www.php.net/)
// >To unsubscribe, visit: http://www.php.net/unsub.php
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
//