Reply to Re: adding a / to code numbers...

Your name:

Reply:


Posted by Steve on 12/07/05 13:36

> My database has a variable $codename and the fields are populated with G115
> up to say G1515.... the first 2 or 3 (in the case of a string of 4)digits
> represent a Gallery and the last 2 digits represent the painting number. I
> want to add a / between the gallery and painting number so for example G215
> will become G2/15 and G1316 will become G13/16.

UPDATE mytable
SET codename =
CONCAT(
LEFT( codename, LENGTH( codename ) - 2 ),
CONCAT( '/', RIGHT( codename, 2 ) )
)

---
Steve

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация