$sql = "Select photos.*, categories.cat FROM photos, categories
WHERE photos.cat_id = categories.id AND photos.status ='1' AND videos.dateposted >= DATE_SUB(videos.dateposted, INTERVAL 24 HOUR) ORDER BY (videos.up-videos.down) DESC
LIMIT $start, $limit";
$result = mysql_query($sql);
Anyway, i cant see "videos" in your query. And date sub only return a date -> date = videos.dateposted - 24 hour
I mean do you need the users table in your query? Not enough to check whether a submission has a user?
If you need users datas and dont specify a user or users set in WHERE clause your query is ok i think.
Refresh the page at a fix time?
Youre mean a console script?
Eg in Linux:
Write a console PHP script, and than create shell script what calls your PHP script and then put your shell script into CRON.
Hi,
I dont see "Using index" in your Explain datas. So, indexes may helps a bit. Another thing is optimization, try to optimize your table. It helps you if your table has had a lots of deleted rows.
Yeah, and whats the problem. First use google, and if you stuck than ask a question: simple_xml_tutorial
Anyway, if you know a specific element what you want to get use xpath.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.