1 Replies - 379 Views - Last Post: 06 February 2010 - 04:21 AM Rate Topic: -----

#1 Guest_JackyRock*


Reputation:

Problem in fetching rows from mysql in php?

Posted 06 February 2010 - 03:48 AM

Hi Friends,
I tried:
I inserted a row in my sql using php in the first web page and second web page i tried to retrieve it.
I got:
But in the next page i did not get the lately inserted row.
When inserted the another row, i was able to get the first inserted row and not the latest 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?

This post has been edited by JackOfAllTrades: 06 February 2010 - 06:03 AM
Reason for edit:: Removed Spam


Is This A Good Question/Topic? 0

Replies To: Problem in fetching rows from mysql in php?

#2 Cbeppe  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 215
  • Joined: 16-September 09

Re: Problem in fetching rows from mysql in php?

Posted 06 February 2010 - 04:21 AM

It would be helpful if you post your code, but I think I know what you mean anyway. I have had the same problem myself.

Try to include your mysql_fetch_array in your while lood like this:

while($row = mysql_fetch_array($res)){


Also make sure that you do not have the same line before the while loop.

I hope it works, and if not, please post your code so we can see your problem more clearly.

Cbeppe.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1