1
$sql="INSERT INTO sales ( date, po ) 
VALUES
('$_POST[date]','$_POST[po]')

select('$_POST[date]'.'$_POST[po]')";

how can i insert multiple in "po" field

i want to insert more information in "po" just like the products, quantity, total amount! how would i insert multiple data in "po"

will i use another table on this!

pls help me on this!

if i could just attached image i love it but stackoverflow didnt allow new user to attached image

edit: Reformatted codeblock

1
  • 1
    Taking all data in a single fields will give you and fellow other members to readablity and coding issues. only you can understand it.. make some extra tables fields where you can store other product details seperately.. This is the best practice.. As mentioned @FreudianSlip you can add the table fields Commented Mar 20, 2012 at 7:26

2 Answers 2

1

Without trying to sound "smart" here, you're going to need to re-evaluate how you store data. There are a few options here, but probably the easiest given your example is to have 2 tables, one a "header" and one a "detail".

The header table might contain the PO Number, Date, Supplier, Total etc... and the detail table would be something like, PO Number (link), Item Number, Description, Qty, Price, VAT Rate etc.

Sign up to request clarification or add additional context in comments.

1 Comment

FreudianSlip OK example under "PO" is the quantity, unit ,product and the amount! example the customer has 2 order example 2 box spoon $1000 and 3 box for $1500! how would i code it using PHP, thanks so much
0

You can either use a comma delimited set of brackets for more of the same structure, ie

 ('$_POST[date]','$_POST[po]'), ('$_POST[date]','$_POST[po]'), ('$_POST[date]','$_POST[po]')

You can add more fields to your table too to include other stuff.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.