Tasos Posted April 14, 2014 Share Posted April 14, 2014 Hello, i need some help to change something from database if possible. Lets say this is my the table row that i want to change. | Duration | 10000 < this is 1 hour 1:00:00 < and i want to change it to this automatic and ad this ( : ) 2000 20:00 300 3:00 is that posible ? if yes can somebody explain what i need and how i can change it direcly. Or is that possible directly from database ? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/287766-how-to-add-automatic/ Share on other sites More sharing options...
requinix Posted April 14, 2014 Share Posted April 14, 2014 (edited) substr will give you a piece of a string. If it has >=3 digits then add a colon between the first and second characters. If it has 5 digits then add one between the fourth and fifth (because you added a colon earlier) digits. Edited April 14, 2014 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/287766-how-to-add-automatic/#findComment-1476138 Share on other sites More sharing options...
MECU Posted April 15, 2014 Share Posted April 15, 2014 If you have a choice, storing the values in another format would be much better. http://dev.mysql.com/doc/refman/5.0/en/time.html Quote Link to comment https://forums.phpfreaks.com/topic/287766-how-to-add-automatic/#findComment-1476154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.