Advertisement
AMONRA75

PHP7 - COUNT ROW DB

Mar 26th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // connessione al db
  2. $mysqli = new mysqli("127.0.0.1:3306", "root", "", "polo");
  3.  
  4. /* check connection */
  5. if ($mysqli->connect_errno) {
  6. echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
  7. }
  8.  
  9.  
  10. $sql = $mysqli->query("SELECT COUNT(*) FROM orden");
  11. $row = $sql->fetch_row();
  12. $count = $row[0];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement