Results 1 to 6 of 6
  1. #1
    JackyRock is offline Freshman
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default Problem in fetching rows from mysql in php?

    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?




    thanks................
    .........................

  2. #2
    crestremovals is offline Freshman
    Join Date
    Feb 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    very interesting question but I don't know about this if I get any suggestion I will post here dude


    Thanks nice to meet you

  3. #3
    Alison Clarke is offline Freshman
    Join Date
    Feb 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    Does your database table have a primary key, or at least a field with a a unique index? If not, you have no way to specify the particular record you want to retrieve.

    Also, how are you doing the insert? INSERT INTO will always add a new row, which I believe is what you want, but if the record you are inserting has no unique field, then when you try to get the record you will always get the first row in the table.

  4. #4
    numberone's Avatar
    numberone is offline Senior
    Join Date
    Jan 2010
    Posts
    623
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    I believe MySQL has instituted optimization procedures that delay commits. This maybe what you are seeing.

    Q...

  5. #5
    saviourdlima is offline Freshman
    Join Date
    Apr 2010
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default

    I personally feel that the problem is basically because of database tables or unique index. If not applicable then you have to specify records you need to retrieve.

  6. #6
    Advanox's Avatar
    Advanox is offline Sophomore
    Join Date
    Sep 2010
    Posts
    61
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    the index/records dont add. what php version are you using?
    TheRACK - RackShack 1Package Fits All Web Hosting. INSTANT activation INSTANT setup FREE transfers RackShack.ORG Order Now

Similar Threads

  1. Replies: 3
    Last Post: 08-13-2011, 06:19 PM
  2. Replies: 5
    Last Post: 04-06-2011, 09:16 AM
  3. MySQL Best Practices
    By eusha in forum Databases
    Replies: 5
    Last Post: 12-11-2009, 03:42 AM
  4. Speeding PHP Using APC PHP Cache
    By HIMMY in forum PHP
    Replies: 2
    Last Post: 10-26-2009, 10:49 AM
  5. Replies: 1
    Last Post: 07-06-2009, 10:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS