[thelist] MySQL/PHP - copy record?

Anthony Baratta Anthony at Baratta.com
Tue Aug 13 13:02:00 CDT 2002


At 07:45 AM 8/13/2002, Bill Haenel wrote:

>Anyway, I have a record in a MySQL DB and I want to put a button on my form
>that says 'copy this record'.
>
>I can think of several ways this can be done using PHP, but what I'd really
>like to do it make it happen almost (if not) 100% by query, to avoid messy
>coding. Is there a way to do this all via SQL? All info from one record to
>the other would be duped except for date (not datestamp) and id.

Something like this??

Form passes Row ID (##) to PHP Script.

insert into Table1 (Fld1, Fld2, Fld3)
values (select Fld1, Fld2, Fld3 from table1 where ID = ##)


---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."




More information about the thelist mailing list