avaterera Posted November 18, 2009 Share Posted November 18, 2009 Hey everyone. I'm quite new to PHP and I need help with my little project. I want to do something like this : Scenario: In first column I have movie clips with specific time each. I want to be able to transfer some clips with specified time into second one, sum their times and save this selection in new row according to selected date. Can somebody please give me some tips how this can be done? Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/ Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 is it from one column to another or from one table to another ? Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960266 Share on other sites More sharing options...
avaterera Posted November 18, 2009 Author Share Posted November 18, 2009 is it from one column to another or from one table to another ? Well... I don't know yet. I'm looking for a way to easily select clips (even multiple times), arrange them and save to database. Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960274 Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 a table to another would be pretty easy stuff but what is the structure of the first table you want to transfer from, and the structure of the table you want to transfer too Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960276 Share on other sites More sharing options...
avaterera Posted November 18, 2009 Author Share Posted November 18, 2009 I think from one table to another will be OK I need three informations in both tables: ID movie name movie time st In future I'll try to auto sum movie times in second column to know when exactly next one is starting, but as I said this is future Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960288 Share on other sites More sharing options...
rajivgonsalves Posted November 18, 2009 Share Posted November 18, 2009 you could construct a select statement from table1 (source) then use the it with INSERT statment on table2 (destination) INSERT INTO table2 select *.... from table1.... Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960292 Share on other sites More sharing options...
avaterera Posted November 18, 2009 Author Share Posted November 18, 2009 you could construct a select statement from table1 (source) then use the it with INSERT statment on table2 (destination) INSERT INTO table2 select *.... from table1.... Hmm... So I can do something like this... Display all source movies through the loop as links with specified Id in first column and when link is clicked INSERT command is activated right? But is it possible using pure PHP to just select movie and then use arrow to transfer it to second column? Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960303 Share on other sites More sharing options...
Zane Posted November 18, 2009 Share Posted November 18, 2009 But is it possible using pure PHP to just select movie and then use arrow to transfer it to second column? I believe you've got everything backwards or fumbled around .. as far as languages go. You would use PHP.. to retrieve the movies and put them into these "columns". I put columns in quotes because I'm talking about the image of two columns you gave. As I'm sure you know, those columns (in the image) aren't representative of the database itself. They are simply placeholders. All PHP does is put the data into one of those place holders at the beginning of the page load. Now, to move one of those "datas" to the other placeholder...using a button. You would use Javascript. That will be the only way... well there are options like Flash,Java,Ruby.etc.. but to make things easier. This is a Javascript question. So you've moved all the data from one placeholder to another... this doesn't mean ANYTHING for the database yet. At this point you have 2 options. 1.) You can send the contents of the second placeholder to another PHP page which THEN adds/edits/inserts/ it into the database. 2.) You can use Javascript again to initiate AJAX to put that stuff in the database INSTANTLY. I'll move this to Javascript now as you'll get better help there. Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960310 Share on other sites More sharing options...
avaterera Posted November 18, 2009 Author Share Posted November 18, 2009 OK. Thank You guys for help. Can now somebody tell me where I can learn more about ajax and how it can be done to instantly update database? Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960321 Share on other sites More sharing options...
Zane Posted November 18, 2009 Share Posted November 18, 2009 First you need to show what you yourself have done.. besides post a screenshot of your idea. Where is your current code? Quote Link to comment https://forums.phpfreaks.com/topic/182048-transfering-data-from-one-column-to-another/#findComment-960324 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.