I have an SQL Query
SELECT COUNT(*) AS tot_std
FROM `login`
WHERE `login_account_type` =
'STUDENT'
The output of this query is 9.
What I want is to add:
- Three zeros if the number is small than 10, like 0009.
- Two zeros if the number is small than 99, like 0099,
- One zero if the number is smaller than 999, like 0999.
- If the number is equal to or greater than 1000, don't add any zero.
Note that I am using PHP Codeigniter and MySQL for the project.
Please Help.