Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

MYSQL many-to-Many database using PhpMyAdmin

InnoDB PHPMyAdmin URL parameter mysql

  • Please log in to reply
1 reply to this topic

#1 harshamutu

harshamutu

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:C
  • Learning:C

Posted 10 September 2012 - 07:29 PM

Hi! Everyone,
I am quite new to PHP and Mysql, but capable of creating a simple database, upload it and make a PHP query to get a result displayed on a webpage using Phpmyadmin. Because of the challenge that I am going to detail below I read a lot on M-to-M databases and creating mapping tables etc. But I am still not sure where to start my assignment yet. My problem has two parts:
1) How to create a MySQL database using Phpmyadmin, for a Many-to-Many relationship. There are many suppliers and a limited number of products. One supplier may have more than one product to offer and one product can be available with several suppliers? (I guest Supplier, Products and the Mapping should have different tables in this database.)

2) How can I get all the suppliers of one particular product displayed on the webpage dedicated to that particular product? If a URL parameter could be used for this how can I define a URL parameter for this purpose?

I shall appreciate very much if some one can advise me on these tasks and/or let me have URLs of tutorials that address these specific issues.

Thanking you in advance
Harsha Mutucumarana
  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 11 September 2012 - 11:33 AM

1) It sounds like you'll want a supplier table, a product table, and a join table to link them.
2) You'll need to use joins in your queries.
  • 1

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download