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? Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.