Question:

PHP / MYSQl?

by  |  earlier

0 LIKES UnLike

I have the following table structure:

id cat vendor

1 101 1

When someone add a record I should be able to give them a stock number with the following format

CAT VENDOR ID

000 00 0000

The problem is I cannot figure out how to display it that. For example, if the record is as this:

id cat vendor

1 101 2

I could only display this as the stock number

CAT Vendor ID

101. 1 2

when it should be :

CAT VENDOR ID

101 01 0002

 Tags:

   Report

1 ANSWERS


  1. You can use printf. For example, for vendor id:

    printf("%04s",$vendor_id);

You're reading: PHP / MYSQl?

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.