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 8548037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:24:08+00:00 2026-06-11T13:24:08+00:00

I am facing a bug I guess, the database records the date format as

  • 0

I am facing a bug I guess, the database records the date format as YYYY-MM-DD, below is the table:-

table

The 1st table is the funds and the second is the fundshistory, as you can see LibraIncomeExtra Fund has the same date, but it still show stars.
Below is my coding:-

<?php

$result = mysql_query("SELECT * FROM funds");
$numrows = mysql_num_rows($result);
$getdate = date('y-m-j');
while($row = mysql_fetch_array($result)) 
  {

echo "<tr>";
echo "<td>";
echo "<center>";

if ($row['nav'] != $row['oldnav'])
{

if ($row['date_update'] != $getdate)
{
echo "" .$row['fundname']. "**";
$latestupdate = $row['date_update'];
}

}
else
{
    echo $row['fundname'];

}



echo "</center>";
echo "</td>";
echo "<td>";
echo"<center>";
echo $row['nav'];
echo "</center>";
echo "</td>";
echo "</tr>";


  }
?>

Anyone can explain this?
I know mysql extension is decprecated, but this coding was made long time ago, so I don’t wish to redo to whole system by just changing mysqli extension.

  • 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-11T13:24:10+00:00Added an answer on June 11, 2026 at 1:24 pm

    I managed to solve it myself by using this coding:

    <?php
    
    $result = mysql_query("SELECT * FROM funds");
    $numrows = mysql_num_rows($result);
    $getdate = date('Y-m-d');
    
    while($row = mysql_fetch_array($result)) 
      {
    
    echo "<tr>";
    echo "<td>";
    echo "<center>";
    
    if ($row['date_update'] == $getdate)
    {
        echo "" .$row['fundname']. "**";
        $latestupdate = $row['date_update'];
    }
    
    else
    {
        echo $row['fundname'];
    }
    
    
    echo "</center>";
    echo "</td>";
    echo "<td>";
    echo"<center>";
    echo $row['nav'];
    echo "</center>";
    echo "</td>";
    echo "</tr>";
    
    
    
    
     }
    ?>
    

    The reason why it shows star is because using while for each line is being checked, as you refer the top previous coding I made, it is satisfy both statement, which require nav and old nav to be different which is true according to the table, next the date from database on table funds and current date on $getdate, which is both are also different that cause both statement to be true and execute the if statement coding. It is kinda stupid for me for not to see the mistake on the if condition. Thanks to firestream for giving that $getdate solution. AND I MADE A MISTAKE, the fundshistory table does not involved in this error.

    THIS IS A TRICKY QUESTION 😀
    Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm curios if this can be achieved as I'm currently facing a bug and
I'm facing a strange bug. Page.ResolveUrl(~/myPage.aspx?param=valueA:valueZ); And it just not work, visibly cause of
The problem I am facing with below code is that whenever I try to
I am facing problems with Refinement Panel in SharePoint 2010 . Please find below
I have some confusion. Not really a bug or issue I am facing. I
I am trying to ascertain if I am facing a bug or simply lack
Hi I am facing a weird bug, I am writing a tag like <div
hey guys, i'm facing a little annoying bug that's in my case not really
I am facing problems with Firefox for HTML5, the below code should work fine
I'm facing a weird bug , if i remove the first layout(id = firstLayout)

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.