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

  • SEARCH
  • Home
  • 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 8053925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:00:39+00:00 2026-06-05T08:00:39+00:00

Trying to work on a clients site and I am having a bit of

  • 0

Trying to work on a clients site and I am having a bit of difficulty. When I have no entries in the database, it catches at if(!row) and displays the message. This part works fine. My issue is when I have entries in the db, they do not display. I know the while loop works because I have several pages running a similar loop. In fact, this loop was copied from another page that displays this entry’s information on a public page.

I know this site is mainly for questions, but I think I just need a fresh pair of eyes to look at my code(I’ve been coding for over 12 hours and I’m a bit tired). A lot of the code below is from a previous web designer and if it were up to me, I would just rewrite the entire site because the code is “out of date”, but the client just wants me to improve on it. Any help would be greatly apprecieated.

$row = mysql_fetch_array($result);

if (!$row) {
    echo '<tr><td bgcolor="ffffff" colspan="3"><font face="arial,helvetica" size="2" color="000000">There are no entries at this time, check back later.</font></td></tr>';
} else {
    while ($row = mysql_fetch_array($result)) {

        echo '<tr>
                    <td bgcolor="ffffff"><font face="arial,helvetica" size="2" color="000000">$date - $row["theme"]</font></td>
                    <td bgcolor="ffffff" align="center">
                    <form action="dsp_modifyposition.php">
                        <input type="hidden" name="specialID" value="$row["specialID"]">
                        <input type="hidden" name="theme" value="$row["theme"]">
                        <input type="submit" value="  Modify  ">
                    </form>
                    </td>
                    <td bgcolor="ffffff" align="center">
                    <form action="act_deleteposition.php" onsubmit="return confirm(\'Are you sure you want to delete this event: $date \')">
                        <input type="hidden" name="specialID" value="$row["specialID"]">
                        <input type="hidden" name="theme" value="$row["theme"]">
                        <input type="submit" value="  Delete  ">
                    </form>
                    </td>
                </tr>';
    }
}
  • 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-06-05T08:00:40+00:00Added an answer on June 5, 2026 at 8:00 am

    When you call mysql_fetch_array for the first time, the mysql result pointer is moved to the next row. Because nothing is done with this row, this first row does not get displayed. What you want is mysql_num_rows to check how many rows are in the resultset. As a side-note, I would suggest using mysql_fetch_assoc if you’re not using the numeric indices.

    if (!mysql_num_rows($result)) {
        echo '...';
    } else {
        while ($row = mysql_fetch_assoc($result)) {
            echo '...';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this htaccess setup on my clients site, they use godaddy RewriteEngine On
I have a site a client is trying to use that doesnt work on
I'm trying to configure Nginx to work with Socket.IO and I have found this
I'm trying to use the example from this site to do client site validation.
I am trying to code an app for work where our clients can edit
I'm currently trying to understand how IPv6 adresses work. There are link-local and site-local
I'm trying to scrape the login page of a site I work on and
Im trying to create a server/client application that will work on two or more
I am trying work out with MERGE statment to Insert / Update Dimension Table
Trying to work with Eclipse for Android (ADT plugin) development at my iMac (2.4Ghz,

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.