-2

I am new to complicated databases. I want to add supplier detail I the database, which has 3 tables with name product, supplier, and purchase invoice.

product have an id(primary key), product_name, and supplier_name(foreign key)

A supplier have a supplier_name and supplier_detail

and purchase invoice have reference_no#(primary key) product_id(foreign key) product_price product_quantity amount_paid and purchase_date

I want to add detail in database using php form but how could I? I am confusing with multiple table and foreign key.

Need suggestion as well as answer with source code? And also I want to know is database I have created is correct or not?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Please read [What topics can I ask about](http://stackoverflow.com/help/on-topic) and [How to ask a good question](http://stackoverflow.com/help/how-to-ask) And [the perfect question](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) And how to create a [Minimal, Complete and Verifiable example](http://stackoverflow.com/help/mcve) – RiggsFolly Jan 16 '17 at 19:12
  • We don't write code on demand here. If you can give your problem a go, we can help if you get stuck. Do you have your tables created in a MySQL database? If so, write a PHP-based form that inserts into just one table to start with. If you need a hand, there are lots of tutorials to help you do that. – halfer Jan 16 '17 at 19:49

1 Answers1

2

I honestly would recommend you start reading first about relations in databases.

This would help you a lot.

halfer
  • 19,824
  • 17
  • 99
  • 186
Michael
  • 51
  • 4