简体   繁体   中英

Display static data in html page

I have a dynamically changing mysql table(issuelist) with columns issueno.,issuetime and status. I display only issues with certain status(bad) in a html page.

"select issueno.,status from issuelist where status='bad' group by issueno.;"  

Now I want to make the webpage static from Sunday to next Sunday, ie, if the status of an issue changes from bad to good on tuesday , even then I want the page to display that particular issue with status = bad till next Sunday . How can I achieve this?

You need to store the data somewhere in your database (for example you could add a column fixdate that would be NULL for issues with status that was good from the beggining or the date of the fix for the issues that changed status. That way, you could specify a static date to compare with the fixdate then show 'bad' or 'good' depending on the case.

Also you don't need to GROUP BY in a single table query with no operation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM