onedumbcoder Posted January 2, 2009 Share Posted January 2, 2009 is it possible to do something like this? INSERT INTO tablea(a,b,c) VALUES('1','2','3') USING tablea INNER JOIN tableb WHERE tableb.id = 'dfsf' AND tableb.password='dfsd' if so can u please provide the correct syntax? Link to comment https://forums.phpfreaks.com/topic/139210-insert-into-tablea-if-conditions-meet-data-from-tableb/ Share on other sites More sharing options...
Gamic Posted January 4, 2009 Share Posted January 4, 2009 You could do something like this: insert into tablea(a,b,c) select a, b, c from ( select '1' as a, '2' as b, '3' as c, 'someID' as id, 'somepassword' as password ) as tmp inner join tableb on tableb.id = tmp.id and tableb.password = tmp.password Link to comment https://forums.phpfreaks.com/topic/139210-insert-into-tablea-if-conditions-meet-data-from-tableb/#findComment-729011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.