Mysql result

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jorntk@yahoo.com

    Mysql result

    I have a php script that insert database record into the mysql
    database, the primary key of the table is auto incremented. how do i
    get the primary key of the last record entered?

    thanks and regards

    Jorn
  • Jan Pieter Kunst

    #2
    Re: Mysql result

    In article <e9da850b.04041 10328.201e520b@ posting.google. com>,
    jorntk@yahoo.co m (jorntk@yahoo.c om) wrote:
    [color=blue]
    > I have a php script that insert database record into the mysql
    > database, the primary key of the table is auto incremented. how do i
    > get the primary key of the last record entered?
    >
    > thanks and regards
    >
    > Jorn[/color]

    Either from within MySQ: "SELECT LAST_INSERT_ID( )", or with the built-in
    PHP function mysql_insert_id (). Warning: the PHP function gives
    incorrect results if the id is of type BIGINT.

    See <http://nl.php.net/manual/en/function.mysql-insert-id.php>.

    JP

    --
    Sorry, <devnull@cauce. org> is een "spam trap".
    E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.

    Comment

    Working...