I have a little difficulty understanding how to do an INSERT SELECT.
For example, I have two tables.
TABLE : users
id | name | gender
1 | John | m
2 | Mary | f
TABLE : website
fid | url | id
1 | www.desilva.biz | 2
2 | gidhelp.com | 4
Now let's say I want to add another query to the table website. I get two variables, say:
$user = John;
$site = "www.google.com";
I want to select the John table identifier from users and paste it into the website table in one statement.
How can i do this?
source
share