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
https://forums.phpfreaks.com/topic/105806-join-4-5-tables/#findComment-542984
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
https://forums.phpfreaks.com/topic/105806-join-4-5-tables/#findComment-542995
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
https://forums.phpfreaks.com/topic/105806-join-4-5-tables/#findComment-543014
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.