clay1 Posted October 11, 2009 Share Posted October 11, 2009 Anyone have any tutorials or directions on creating invoice numbers? I have a table called invoices with a column named invoicenumber which is set to a serial I want to be able to assign a new invoice the next number in the sequence. Quote Link to comment https://forums.phpfreaks.com/topic/177280-invoice-numbers/ Share on other sites More sharing options...
artacus Posted October 16, 2009 Share Posted October 16, 2009 Easiest way would be to use the keyword DEFAULT for the invoice number. INSERT INTO invoices (invoicenumber, invoice_time, customer_id) VALUES (DEFAULT, current_timestamp, 222); Otherwise you can use nextval('invoice_seq') where invoice_seq is the name of your sequence. Quote Link to comment https://forums.phpfreaks.com/topic/177280-invoice-numbers/#findComment-937850 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.