Home Submit a Ticket Knowledgebase News
Knowledgebase : MySQLi
Fungsi mysqli_query()
Posted by Ari Sigit on 10 June 2019 01:10 pm

Definisi dan Penggunaan

Fungsi mysqli_query () melakukan kueri terhadap database.

Contoh Script:

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

// Perform queries 
mysqli_query($con,"SELECT * FROM Persons");
mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) 
VALUES ('Glenn','Quagmire',33)");

mysqli_close($con);
?>

Butuh Bantuan? Hubungi kami: +62 8515-5020-504