You are here: Re: adding a / to code numbers... « PHP SQL « IT news, forums, messages
Re: adding a / to code numbers...

Posted by plato on 12/08/05 12:29

"Steve" <googlespam@nastysoft.com> wrote in message
news:1133955388.084012.84570@g47g2000cwa.googlegroups.com...
>
> > 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
I worked out I got the codename and number mixed but even this

SELECT *
FROM `photos`
UPDATE 'photos' SET codenumber = CONCAT( LEFT( codenumber, LENGTH(
codenumber ) -2 ) , CONCAT( '/', RIGHT( codenumber, 2 ) ) ) LIMIT 0 ,
30

gave me the same reply?

 

Navigation:

[Reply to this 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

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