I have a primary key field (news_id) in the news table
it start from 1, 2, 3, 4 and so on..
However, I like to change to 01, 02, 03, 04,e tc ... is that possible?
If not, how can that be done in PHP?
Manipulating the keys directly is a bad idea in 99% of cases.
The best way to go is probably to change the format when outputting the keys like shown in this question:
$key = 4;
echo sprintf('%02d', $key); // outputs 04
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With