Guest User

Untitled

a guest
Dec 15th, 2019
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $conn1 = new mysqli("localhost", "my_user", "my_password", "world");
  3.  
  4. /* проверка соединения */
  5. if ($mysqli->connect_errno) {
  6. printf("Не удалось подключиться: %s\n", $conn1->connect_error);
  7. exit();
  8. }
  9.  
  10. $set="1";
  11.  
  12. $query1 = "SELECT * FROM table1 WHERE group = ".$set." ";
  13.  
  14. $result = $conn1->query($query1);
  15. while($row2 = mysqli_fetch_assoc($result))
  16. {
  17. $arr2[]=$row2;
  18. }
  19.  
  20. $row=count($arr2);
  21.  
  22. echo '<table border="1">';
  23. for ($tr=0; $tr<$row; $tr++){
  24. echo'<tr>';
  25. echo '<td>'.$arr2[$tr]["id"].'<td>'.$arr2[$tr]["group"].'<td>'.$arr2[$tr]["position"].'<td>'.$arr2[$tr]["text"].'</td>';
  26.  
  27. echo '</tr>';
  28. }
  29. echo '</table>';
  30. ?>
RAW Paste Data