Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:52:50+00:00 2026-05-26T15:52:50+00:00

I have a database with a singe table, and two fields in said table,

  • 0

I have a database with a singe table, and two fields in said table, an ID number and filename. I use this DB to allow paging in a php script so I can show a set number of photos per page.

Here are the first 5 entires, and the code I use to sect from the databse:

1 - DSC_5480.jpg
2 - DSC_5483.jpg
3 - DSC_5487.jpg
4 - DSC_5488.jpg
5 - DSC_5489.jpg

And the code to print this in HTML:

if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 25; 
$data = mysql_query("SELECT * FROM $db_base.$db_tble LIMIT $start_from, 25")
or die(mysql_error());
$pictures = mysql_fetch_array( $data );


while($pictures = mysql_fetch_array( $data ))
{
echo "\t\t" . '<img src="images/' . $pictures['filename'] . '" alt="' . $pictures['filename'] . '" />' . "\n";
}

The problem I’m running into is the first entry in the table is skipped as you can see from the HTML code.

<img src="images/DSC_5483.jpg" alt="DSC_5483.jpg" />
<img src="images/DSC_5487.jpg" alt="DSC_5487.jpg" />
<img src="images/DSC_5488.jpg" alt="DSC_5488.jpg" />
<img src="images/DSC_5489.jpg" alt="DSC_5489.jpg" />
<img src="images/DSC_5491.jpg" alt="DSC_5491.jpg" />

So my question is what am I doing wrong to not allow the first entry to be displayed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:52:51+00:00Added an answer on May 26, 2026 at 3:52 pm

    Take a look at code-snippet, you have write twice this statement : $pictures = mysql_fetch_array( $data );

    It should be,

    $data = mysql_query("SELECT * FROM $db_base.$db_tble LIMIT $start_from, 25")
    or die(mysql_error());
    
    while($pictures = mysql_fetch_array( $data ))
    {
    echo "\t\t" . '<img src="images/' . $pictures['filename'] . '" alt="' . $pictures['filename'] . '" />' . "\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables that I'm querying from. In one table, there are fields
I have a table called Recharge in a Access Database. Some of the fields
I have a product table with a product name, two product attributes fields, and
Let's say you have a database with a single table like... --------------------------------------------- | Name
I have a database containing a single huge table. At the moment a query
I have a fairly huge database with a master table with a single column
I have database with many tables. In the first table, I have a field
I have database application, I want to allow the user to restore the deleted
I'm trying to head this one off at the pass. I've got two database
I have a database with a table that contains Name and CompanyName . They

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.