herghost Posted October 15, 2009 Share Posted October 15, 2009 Hi all, I need to create a mysql table from php that goes a little something like this id, name, total, place1today, place1yersterday however place1today and yersterday need to goto place2, place3 upto 100! Is there a quick way or will I have to create each one manually? Many Thanks Link to comment https://forums.phpfreaks.com/topic/177827-solved-is-there-a-quick-way-to-do-this/ Share on other sites More sharing options...
cags Posted October 15, 2009 Share Posted October 15, 2009 Are you saying you wish over a 100 columns, all listed place1, place2... place100? If so it sounds like bad database design and you'd be better off normalising the data. Link to comment https://forums.phpfreaks.com/topic/177827-solved-is-there-a-quick-way-to-do-this/#findComment-937671 Share on other sites More sharing options...
herghost Posted October 16, 2009 Author Share Posted October 16, 2009 Hi, Well I have 100 different locations, and each one will hold the average rainfall for this location. How would you suggest I go about this? Link to comment https://forums.phpfreaks.com/topic/177827-solved-is-there-a-quick-way-to-do-this/#findComment-937940 Share on other sites More sharing options...
Mark Baker Posted October 16, 2009 Share Posted October 16, 2009 Two tables Table 1: id, name, total Table 2: id,placeID,placeToday, placeYesterday Where the id in table 2 is the same as the id in table 1, and placeID is your value between 1 and 100 Link to comment https://forums.phpfreaks.com/topic/177827-solved-is-there-a-quick-way-to-do-this/#findComment-937942 Share on other sites More sharing options...
herghost Posted October 16, 2009 Author Share Posted October 16, 2009 Perfect Mark, Many thanks Link to comment https://forums.phpfreaks.com/topic/177827-solved-is-there-a-quick-way-to-do-this/#findComment-937944 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.