mysql

Execute sql query when clicking link in PHP

I am using WordPress and have a table with Name and Price data.
I want a link, in a third column called "Add to my portfolio", and by clicking this link the Name and Price data should be added to the table user_portfolio.
This is…

MySQL Join with min and max date

I have two tables
profile
——–
id
name

Profile_dates
————–
id
profile_id
entry_date

The tables have 1 to many relationships
I want to get min and max entry_date for each profile like
id
name
profile_dates.first_date
profile…

Insert into with join

so i have 2 databases one called comments and users but in a query i need to get username from users
INSERT INTO comments SELECT (text, post_id, user_id, created, username ) FROM comments INNER JOIN users values (:text, :post_id, :user…