Jump to content

bh

Members
  • Posts

    238
  • Joined

  • Last visited

Everything posted by bh

  1. $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
  2. Maybe the script was wrong, still you have the trigger script?
  3. Hi, DATE_SUB(dateposted, INTERVAL 168 HOUR);
  4. Hi, If you dont wanna do from your PHP script, yes you can use MySql Triggers. The MySQL manual helps you.
  5. bh

    Slow Query

    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.
  6. Hi, Use isset to decide is the variable is set and not null. Eg like this: if (isset($_POST['submit'])) { }
  7. bh

    Slow Query

    Dont enough if you join the site and submission table where submission.userid is not null?
  8. bh

    Slow Query

    You see its get all of the users (77369)...
  9. bh

    Slow Query

    The problem is in the first row: "ALL". Is there an index on s.siteID?
  10. bh

    Slow Query

    Yeah, Group by cause "Using temporary; Using filesort", and these are the bad ones. edit: Anyway, with "SELECT DISTINCT" and without "GROUP BY" ?
  11. bh

    Slow Query

    Maybe if you Analyze the table?
  12. I gave you a link. Or Google...
  13. 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.
  14. bh

    Slow Query

    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.
  15. bh

    Columns

    Its rather a HTML topic, i think. Example use HTML tables?
  16. Hi, Whats wrong with the "NOT IN"? Its working very well.
  17. Hi, You can use DATE_FORMAT(date, format). Eg. like this: SELECT DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00');
  18. Hi, $date = '2010-08-06'; // or 07/08/2010... date('d/m/Y', strtotime($date));
  19. bh

    JOIN statement

    Google helps you.
  20. 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.
  21. Hi, You should get the affected rows when you run UPDATE / DELETE queries.
  22. Hi, for loop Read the notes too.
  23. Use while statement. while ($row = mysql_fetch_assoc($eid2)) { echo $row['id']; }
  24. Hi, Example return with an array or use referenced parameters (out parameter).
×
×
  • Create New...

Important Information

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.