fork download
  1. <?php
  2.  
  3.  
  4. echo "<table><tr><th><a href='index.php?order=name'>Студент</a></th><th><a href='index.php?order=groupindex'>Номер группы</a></th><th><a href='index.php?order=points'>Баллы</a></th></tr>";
  5.  
  6. $sort = 'points';
  7. if (isset($_GET['order'])) {
  8. $sort = $_GET['order'];
  9. }
  10.  
  11. $STH = $DBH->query("SELECT name, sname, groupindex, points FROM students ORDER BY $sort");
  12.  
Runtime error #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
<table><tr><th><a href='index.php?order=name'>Студент</a></th><th><a href='index.php?order=groupindex'>Номер группы</a></th><th><a href='index.php?order=points'>Баллы</a></th></tr>
stderr
PHP Notice:  Undefined variable: DBH in /home/i2jHMD/prog.php on line 11
PHP Fatal error:  Call to a member function query() on a non-object in /home/i2jHMD/prog.php on line 11