Jump to content

Join 4-5 Tables


iceblox

Recommended Posts

Only a really basic table join.

 

 

$query = "SELECT * FROM deals_deals g, deals_models i, deals_gifts f, deals_tariffs j WHERE g.ModelID = i.ModelID AND g.TariffID = j.TariffID AND g.GiftID = f.GiftID or die (mysql_error ())";

	$result = mysql_query($query);



	echo "". $row[MakeName] ."<br>". $row['2'] ."<br>". $row[3] ."<br><br><br><br>";

Link to comment
Share on other sites

It would be really hard to help you accomplish what you're after without some extra information.

 

What are the table structures and if it's not apparent from the structure, how do the tables relate to each other?

 

Then, what exactly do you want to accomplish?

 

Also, you might read this page (along with the user comments), it may give you something to go on:

http://dev.mysql.com/doc/refman/5.0/en/update.html

Link to comment
Share on other sites

the "deals_deals" table is the primary one. As this contains an ID that relates to the of 4 other tables.  Although the one of the IDs can sometimes have a 0 as its value. The idea is to merge it together in one table to make it easier to search to use the data.

 

If this makes sense?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.