Hi, i have a table that is going to have a lot or rows, i don’t want to have to search the whole table for a value with a query i want to check what the last row added was.
So each day a new row will be added, but i want a script to check if today’s date is a new row or not so i only want to check the last entry to the table as if its not equal to today’s date then it will create a new row.
Connect to DB – Which I can do.
Check what the last row entered to the db was – it gets the last row entered and stores its value .
It then compares that value with one that has just been created by using the date function.
If they are the same everything is fine.
If they are different then it enters a new row in the table – this i should be able to do.
I don’t know how the MySQL search mechanism works, but I doubt you’ll be able to do better than this. The biggest tax on your SQL server is the amount of information returned; not how much is searched through. And that’s only noticable if you’re returning thousands of rows of info.
SQL also has a memory function where it will remember a similar query.
I have a friend who created a CMS where every tag, attribute and value was stored separately in the database, and the page still loaded as fast as an HTML page… we have yet to test this on a hundred-visits-a-minute site, but you get the idea.