iceblox Posted May 15, 2008 Share Posted May 15, 2008 Is it possible to update a table based on the contents from 4-5 joined tables? or to create a csv file? If so can someone point me in the right direction please ;o) Link to comment https://forums.phpfreaks.com/topic/105806-join-4-5-tables/ Share on other sites More sharing options...
craygo Posted May 15, 2008 Share Posted May 15, 2008 You can put your results into a multi dimensional array then loop through the array to update your table. Do you have any code as of yet?? Ray Link to comment https://forums.phpfreaks.com/topic/105806-join-4-5-tables/#findComment-542253 Share on other sites More sharing options...
iceblox Posted May 16, 2008 Author Share Posted May 16, 2008 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 More sharing options...
roopurt18 Posted May 16, 2008 Share Posted May 16, 2008 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 More sharing options...
iceblox Posted May 16, 2008 Author Share Posted May 16, 2008 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 More sharing options...
roopurt18 Posted May 16, 2008 Share Posted May 16, 2008 As far as I can tell, the query you have already should work with one change: or die (mysql_error ()) goes outside the quote mark that terminates the query. Link to comment https://forums.phpfreaks.com/topic/105806-join-4-5-tables/#findComment-543105 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.