You are here: Re: mysql wildcards « All PHP « IT news, forums, messages
Re: mysql wildcards

Posted by J.O. Aho on 10/10/86 11:39

mr gumpy wrote:
> I want to update a number of timestamps that look like this 1027094500
> to look like this 20051027094500
> This is the sort of thing I have been trying with no success:
>
> UPDATE `newCalls` WHERE timeStamp LIKE '10%' SET timeStamp LIKE '200310%'
>
> I would be grateful if anyone could tell me what I should be doing.

You need to use CONCAT and it's for strings, not for integers.


UPDATE newCalls SET timeStamp=CONCAT('2003',timeStamp) WHERE timeStamp LIKE '10%';

If your timestamp is in unix time, adding a year infront is to ruin the whole
thing with timestamps.



//Aho

 

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

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