Axeia Posted June 6, 2009 Share Posted June 6, 2009 I got 2 tables with near identical values, the first 3 fields are an exact match. The fourth (downloaded) is a boolean which is unique to the Checked table. Now I want move an entry from Downloads to Checked, do I really have to use 3 queries for this action? 1) INSERT INTO 2) Update the just inserted value to set downloaded to true 3) Remove entry from Downloads table. Seems odd to me, I thought something like the example below (which doesn't work) would be able to combine step 1 and 2. INSERT INTO Checked(date,filename,download,downloaded) SELECT date,filename,download,true FROM Downloads WHERE Downloads.download = :filename Link to comment https://forums.phpfreaks.com/topic/161196-solved-insert-into-from-a-table-with-3-colums-into-one-with-4-marking-the-4th-as-true/ Share on other sites More sharing options...
Axeia Posted June 6, 2009 Author Share Posted June 6, 2009 Ah my bad, goes perfectly fine, just need to use 1 instead of true with mysql not knowing booleans and all. Link to comment https://forums.phpfreaks.com/topic/161196-solved-insert-into-from-a-table-with-3-colums-into-one-with-4-marking-the-4th-as-true/#findComment-850595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.