-1

I've created this column on my DB named trackingcode, it has the UNSIGNED ZEROFILL attribute so it would show the leading zeros in the DB. See below example.

enter image description here

Now I would send these tracking codes through email (PHP form to email). The problem is that on the email, it would only show the whole number but not the zero.

enter image description here

Is there a way to make the leading zeros show up in the email subject?

$email_subject = "PC Request # $newtracking";
Renzo
  • 109
  • 6

1 Answers1

0

Not sure if these values are stored as strings in your database, but either way you can fudge it with this

$val = substr("00" . $newtracking, -3);
Kinglish
  • 23,358
  • 3
  • 22
  • 43