List:General Discussion« Previous MessageNext Message »
From:Jay J Date:January 15 2000 8:04am
Subject:Re: How Do I put ID in multiple tables???
View as plain text  
----- Original Message -----
From: "Jeff Fitzgerald" <jlf@stripped>
To: <mysql@stripped>
Sent: Saturday, January 15, 2000 1:44 AM
Subject: How Do I put ID in multiple tables???


>
> I am admittedly new to database programming, and really appreciate mysql.
> Have 3 tables that I want to insert data into, but need the id to match on
> all three.
> I just don't know how to do this, and tried the example below but did not
> know how
> to call the last insert id up.

[02:00:30 jay@www jay]$ perldoc DBD::mysql | grep insertid
           $insertId = $dbh->{'mysql_insertid'}

[ check your DBD::mysql version ]

One _could_ very carefully rely on auto_increment to achieve this, but I
can't personally recommend this method. You're first inclination seems
preferable, I use mysql_insertid.

> If some mysqlord could spend a moment and offer suggestions as to how to
> best do this code I would so appreciate it. It would be good to start off
> the right way.

Not I, sorry -- perhaps someone else has time to browse the code.

> Also, to get the query I know to use fectch row. But how do I know what
order
> it sends the data in?
>
> Thanks, Jeff

In my experience, fetch retrieves records by the order they were inserted --
however, this is why the "ORDER BY" clause exists.

-Jay J


Thread
How Do I put ID in multiple tables???Jeff Fitzgerald15 Jan
  • Re: How Do I put ID in multiple tables???Benjamin Pflugmann15 Jan
  • Re: How Do I put ID in multiple tables???Jay J15 Jan
    • Re: How Do I put ID in multiple tables???Jeff Fitzgerald15 Jan
  • Re: How Do I put ID in multiple tables???hypnos15 Jan
    • Re: How Do I put ID in multiple tables???Faisal Nasim15 Jan
    • Re: How Do I put ID in multiple tables???Jens Müller16 Jan