Ghufron Asadly. Diberdayakan oleh Blogger.

Create Koneksi Mysqli and Looping data

Rabu, 09 Maret 2016

create Koneksi
 $mysql_servername = "localhost";
$mysql_username = "root";
$mysql_password= "";
$conn_mysql = new mysqli($mysql_servername, $mysql_username, $mysql_password);
if ($conn_mysql2->connect_error) {
    die("Connection mysql failed: " . $conn_mysql->connect_error);
} else{
//    echo "Connected to mysql2 successfully";}
$selectmysql_db = mysqli_select_db($conn_mysql, "database");

Looping data
$result= mysqli_query($conn_mysql, $sql_krs);
    while ($row = $result->fetch_assoc()) {
    $row['nama_field'];
}

Tidak ada komentar:

Posting Komentar

 

Most Reading