This is a discussion on "[SOLVED] Fetch Array problem" within the PHP Forum section. This forum, and the thread "[SOLVED] Fetch Array problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Fetch Array problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[SOLVED] Fetch Array problem
Hello!
I'm trying to show snippets of the most recent 3 posts in a database, which I'm having slight success with. But my query displays the second most recent post followed by the third - the most recent is nowhere in sight! And even though my LIMIT is 3, it only ever shows 2 posts.
Thanks Alex
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
|
|
||||
|
Re: Fetch Array problem
Your problem is here
$info = mysql_fetch_array( $data ); inside the call to the while loop. Because the call to the mysql function changes the array pointer, it skips past the first record when you run it twice. just use while($info = mysql_fetch_array( $data )) {
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Fetch Array problem
Many thanks Rakuli
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
||||
|
Re: [SOLVED] Fetch Array problem
No problems
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fetch the ENTIRE array? | CloudedVision | PHP Forum | 3 | Mar 5th, 2008 13:38 |
| [SOLVED] Array code help | longstand | PHP Forum | 3 | Dec 1st, 2007 15:14 |
| [SOLVED] Array sorting | welshstew | Classic ASP | 6 | Nov 28th, 2007 16:45 |
| [SOLVED] array woes | eon201 | PHP Forum | 1 | Nov 6th, 2007 15:13 |
| Array problem | netwarriorgizmo | JavaScript Forum | 1 | Jul 12th, 2004 21:25 |