<?php

    $mysqli = new mysqli("localhost", "my_user", "my_password", "DBName");

    /* check connection */
    if ( mysqli_connect_errno() )
    {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    if ( $result = $mysqli->query ("SELECT * FROM Users") )
    {
        foreach ( $result->fetch_row() as $data )
        {
            echo $data;
        }
        
        $result->close();
    }

    $mysqli->close();

?>
Categories: PHP language

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *