Skip to main content
Known Participant
January 10, 2011
Question

PHP MySQL SELECT INSERT

  • January 10, 2011
  • 1 reply
  • 1907 views

I have a registration page with a html form. I have created an insert record server behavior that insert all the data into a MySQL database table fine. What I like to do additionally is to insert the data from a single row, actually the last row, into another table in the same mysql database. I have heard of MySQL insert-select but I can't seem to make it work on my own.  Is insert-select possible with Dreamweaver? If not, what should I use?

I appreciate any help

This topic has been closed for replies.

1 reply

January 10, 2011

Inserting all data into another table is redundant. You only need to pass the primary key to a new table when necessary and use the JOIN argument in your query to JOIN data from seperate tables for one user.

irajiAuthor
Known Participant
January 10, 2011

Sorry if I was misleading. I like to pass the data from 3 columns of the last row of the table to another table.

irajiAuthor
Known Participant
January 10, 2011

Ah, yes as TS found, you are redirecting before the sql gets executed. But it will still not work after you fix that because of the field order issue.


Thank you both. The reason for two tables is being notified is a feature not all users select to have and some that will select it need to be notified when a post about them has been written and they need to be notified privately. Does that explain it?

If you think this is redundant, then how should it be done?