Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1.   $user ="gino"; #USER
  2.  $password ="pino"; #PASSWORD
  3.  $db ="database"; #NOME DATABASE
  4.  $dbposition="mysql.quellochevoglio"; #URL MYSQL
  5.  $conn = new mysqli("$dbposition", "$user", "$password", "$db");
  6.   global $conn;
  7.   if (!$conn->select_db("$db")) {
  8.   #chili e chili di codice per mostrare una pagina di errore, ma qui la connessione funziona
  9. }  else {
  10.     #SETTO LOCALE MYSQLI
  11.    $conn->query("SET lc_time_names='it_IT'");
  12.     $conn->query("SET time_zone='Europe/Rome'");
  13.     #ANCHE QUI TUTTO BENE
  14.  }
  15.  
  16. #ALTRA CHILATA DI CODICE FINO ALLE PRIME SELECT
  17.  
  18. $query = "SELECT        qualcosa
  19.                               FROM       `tabella`";
  20.                 $result = mysqli_query($conn, $query);
  21.                 $count = mysqli_num_rows($result);
  22.                 #ERRORE Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in (tutta la path del file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement