Phpmyadmin/Mysqli Questions

I have a database with over 100 rows and growing

I want this

  1. Automaticaly select a row of data every day at a certain time of the day (and it cannot be the same data as the past 10 data pulls?

This means that every day a “random” article will be displayed on my website
How do i do this? and how do i do it the most effecient way lets say i reach over 10.000 rows one day?

Also is there a way i can set the data to be displayed after 1 week? like if i have 3 weekly featured articles? i want to be able to put in 3 new weekly featured articles maybe 1-2-3-4-5 weeks ahead of schedule?

How can i accomplish this? i use php btw :smile:

Create another table where you store the id of the row you’ve displayed.
Then, to select a random row, make a query that left joins the table with your data with the table with the displayed row id’s, where the displayed row id IS NULL (that will give you all rows that haven’t been displayed yet.
To exclude only the last 10 displayed take a look at ORDER BY and LIMIT.
After having selected a row to display, add the selected row id in the new table.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.