Results 1 to 6 of 6
-
12-28-2009, 06:52 AM #1
Freshman
- Join Date
- Dec 2009
- Posts
- 2
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
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................
.........................
-
02-02-2010, 07:16 AM #2
Freshman
- Join Date
- Feb 2010
- Posts
- 2
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
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
-
02-08-2010, 08:27 AM #3
Freshman
- Join Date
- Feb 2010
- Posts
- 2
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
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.
-
02-08-2010, 08:44 AM #4
I believe MySQL has instituted optimization procedures that delay commits. This maybe what you are seeing.
Q...
-
09-08-2010, 11:34 AM #5
Freshman
- Join Date
- Apr 2010
- Posts
- 22
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
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.
-
09-09-2010, 08:34 PM #6
Similar Threads
-
Selling PHP Matrimonial Script (shaadi.com clone) at www.infocuswebdesigning.com
By ashish10 in forum WebsitesReplies: 3Last Post: 08-13-2011, 06:19 PM -
Problem in fetching rows from mysql in php?
By alexmike in forum PHPReplies: 5Last Post: 04-06-2011, 09:16 AM -
MySQL Best Practices
By eusha in forum DatabasesReplies: 5Last Post: 12-11-2009, 03:42 AM -
Speeding PHP Using APC PHP Cache
By HIMMY in forum PHPReplies: 2Last Post: 10-26-2009, 10:49 AM -
Matrimonial Website For Sell, Also Scripts Available (shaadi.com clone) @ www.infocuswebdesigning.com
By ashish10 in forum WebsitesReplies: 1Last Post: 07-06-2009, 10:35 PM



Reply With Quote

