fork download
  1. <?php
  2.  
  3. $stmt = $con->prepare("SELECT n.id_news_sport,
  4. n.url,
  5. n.cover_page,
  6. n.mini_title,
  7. n.mini_description,
  8. n.date_post
  9. FROM
  10. (SELECT main_cover FROM news_sport n GROUP BY main_cover) categories
  11. Cross Apply (
  12. SELECT
  13. n1.id_news_sport as id,
  14. n1.url as url,
  15. n1.cover_page as cover_page,
  16. n1.mini_title as mini_title,
  17. n1.mini_description as mini_description,
  18. n1.date_post as date_post
  19. FROM news_sport n1
  20. WHERE
  21. n1.main_cover = categories.main_cover
  22. LIMIT 10
  23. ) n
  24. ORDER BY n.id_news_sport DESC LIMIT 10");
Runtime error #stdin #stdout #stderr 0.02s 25488KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: con in /home/UoNglF/prog.php on line 3
PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /home/UoNglF/prog.php:3
Stack trace:
#0 {main}
  thrown in /home/UoNglF/prog.php on line 3