thara Posted April 23, 2013 Share Posted April 23, 2013 I am using this query to count user views for particular page.This is my query : INSERT INTO tutor_page_views ( tutor_id, views) VALUES ( $tutorId, 1) ON DUPLICATE KEY UPDATE views=views+1 This query is working. But when it is updating I need to update views something like this 01,02,03,04....10,11,12 etc..At the moment, it works like this 1,2,3....10,11,12 etc.can anybody tell me how can I do this? Quote Link to comment https://forums.phpfreaks.com/topic/277203-changing-number-format-with-update-query/ Share on other sites More sharing options...
Barand Posted April 23, 2013 Share Posted April 23, 2013 Why not format the number on output printf('%02d', $views); Quote Link to comment https://forums.phpfreaks.com/topic/277203-changing-number-format-with-update-query/#findComment-1426074 Share on other sites More sharing options...
thara Posted April 23, 2013 Author Share Posted April 23, 2013 Thanks.. Its work for me. Quote Link to comment https://forums.phpfreaks.com/topic/277203-changing-number-format-with-update-query/#findComment-1426109 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.