Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = new mysqli("server_address","db_user","db_password","db_name");
- // Check connection
- if ( $db->connect_errno ( ) )
- {
- die("Errore di connessione al database MySQL: " . mysqli_connect_error());
- }
- // Perform queries
- $sql = "SELECT * FROM Libro";
- if (!$result = $db->query($sql) ) {
- die("Errore query");
- }
- while ($book = $result->fetch_assoc()) {
- echo $book['titolo'] . ' ' . $book['n_pagine'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement