[thelist] php - mysql insert

rudy r937 at interlog.com
Mon Jul 8 14:28:01 CDT 2002


> if I want to insert a field that is the same as a unique id
> from another table could I use the unique id from the other table?

hi andrew

sure you can

that is how tables "link to" each other

for example, let's say you had a person table (one row per person) and an
email table (one row per email)

the person table would likely have a unique key for each person, and the
most convenient choice is an autoincrement primary key

when you add a person's email to the email table, you must provide a value
for the person's unique id -- this comes from the person table, and it is
essential to use the same values so that the email rows can be properly
matched up with the person rows that they belong to

is that what you were asking?


rudy






More information about the thelist mailing list