[thelist] MySQL/PHP - copy record?

Bill Haenel bill at webmarketingworx.com
Tue Aug 13 13:13:01 CDT 2002


> > 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 = ##)

Yes, that's great! That would definitely do it.

I wonder, though, is there a way to do this without specifying each field
name? It would be nice to not have to go back and edit the code much later
if I decide to add fields or something. Plus, I have many fields in this
particular table, so it would be cool to somehow shorten it. '*' wouldn't
work of course, because it would copy the entire record, and I need a new
date and id. Is there an "ALL BUT" or something?

If there is no other way, this is certainly do-able.

Bill




More information about the thelist mailing list