mysql_insert_id, not working properly

Discussion in 'PHP' started by bandito40, Jun 27, 2008.

  1. #1
    Hi,

    I am having some problems with mysql_insert_id(); After calling my insert query, I can only get mysql_insert_id() to work properly if it is followed directly by exit;. Once I comment out the exit; line, the rest of my code gets executed and the function will only return 0.

    I have tried using the link_identifier returned by mysql_connect() in both the mysq_query() function and the mysql_insert_id() funtion, but no luck.

    Anyone know why?

    Thanks,

    Bandito
     
    bandito40, Jun 27, 2008 IP
  2. 2slick

    2slick Peon

    Messages:
    73
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can you paste your code here.

    thanks
     
    2slick, Jun 27, 2008 IP
  3. bandito40

    bandito40 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry, turned out to be an error in my code. I had it reloading itself and there fore mysql_insert_id() was returning 0. Thanks for you replay however.

    Bandito

    http://www.gaihosa.com
    http://ex500.net46.net
     
    bandito40, Jun 27, 2008 IP