Problem in fetching rows from mysql in php?

Discussion in 'Programming' started by JackyRock, Jan 28, 2010.

  1. #1
    HI Friends,
    I tried:
    I inserted a row in mysql using php in the first webpage and second webpage i tried to retrieve it.
    I got:
    But in the next page i did not get the lastely inserted row.
    When inserted the another row, i was able to get the first inserted row and not the lastest row.

    So every time i miss the last inserted row the first time and when then i was able to get it as soon as i insert another row.

    How to solve this issue? Is it something related to commit i am missing here?
     
    JackyRock, Jan 28, 2010 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    I believe MySQL has instituted optimization procedures that delay commits. This maybe what you are seeing.

    Q...
     
    QiSoftware, Jan 29, 2010 IP
  3. JackyRock

    JackyRock Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    not my friends this is a current problem. i m facing this problems.
     
    JackyRock, Jan 29, 2010 IP
  4. SeoKungFu

    SeoKungFu Active Member

    Messages:
    206
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #4
    you need to post more info like piece of code and what exactly queries you using, I faintly guess you are relying on something like "last_insert_id"...
     
    SeoKungFu, Jan 29, 2010 IP
  5. aljosabre

    aljosabre Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yup, your script might be the problem so show as what you've done. If not, try with COMMIT command after every insertion
     
    aljosabre, Jan 30, 2010 IP