adzie Posted April 25, 2007 Share Posted April 25, 2007 Hi peeps, Still learning this very slowly I might add!. The problem I have I have two Databases as an example table 1 id a name hours d table 2 id 1 name hours 4 I have created a query for table a which sums up all the numbers in table 1c and displays them by table 1a Now I want to take that information and update table 2,2 column by table 2,1 (as an ID being the same as table 1a) Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/ Share on other sites More sharing options...
fenway Posted April 26, 2007 Share Posted April 26, 2007 I'm confused by your description of the problem. Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-238651 Share on other sites More sharing options...
bubblegum.anarchy Posted April 26, 2007 Share Posted April 26, 2007 There is a remarkably high number of confusing questions being posted lately. Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-238750 Share on other sites More sharing options...
adzie Posted April 27, 2007 Author Share Posted April 27, 2007 I've attached a quick idea of the tables I have. The Key field in each Table is VID as that is the members Identity. In Table A I have multiple Rows for each member, I Am looking to total the time for each member by the VID. Then extract that query totalling by VID column and insert into table B again by against each member number [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-239668 Share on other sites More sharing options...
bubblegum.anarchy Posted April 27, 2007 Share Posted April 27, 2007 Ahhh... so you want to insert a record in table B that represent the total time for each VID in table A. INSERT INTO tableB (vid, time) SELECT vid, sum(time) FROM tableA GROUP BY vid; Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-239719 Share on other sites More sharing options...
adzie Posted April 27, 2007 Author Share Posted April 27, 2007 really that simple??? I wont even show you some of the strings I've put together Im also looking to extract certains fields from table A into a TXT file every 30 minutes and insert any extra DB fields Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-239729 Share on other sites More sharing options...
adzie Posted April 27, 2007 Author Share Posted April 27, 2007 Thankyou bubblegum.anarachy ok thats great its putting the information into the correct fields but its adding a row each time the script is run. I'd ideally like it to update the existing rows in table A Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-239761 Share on other sites More sharing options...
adzie Posted April 28, 2007 Author Share Posted April 28, 2007 I've tried using the update command but to no avail?? any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-240331 Share on other sites More sharing options...
adzie Posted April 29, 2007 Author Share Posted April 29, 2007 ok While I wait for an answer can anyone say wether its best to have loads of small DBs or a few large ones Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-241071 Share on other sites More sharing options...
fenway Posted April 30, 2007 Share Posted April 30, 2007 Thankyou bubblegum.anarachy ok thats great its putting the information into the correct fields but its adding a row each time the script is run. I'd ideally like it to update the existing rows in table A Update what with what? Quote Link to comment https://forums.phpfreaks.com/topic/48669-general-db-mysql-php-help/#findComment-241800 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.