Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Bagaimana cara menjalankan kueri sql di php?

Coba kode di bawah ini,

<?php
$conn = new mysqli('localhost', 'jaydeep_mor', 'jaydeep_mor', 'jaydeep_mor');

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
    echo "error";
} 
else{
    echo "conn successful";
}
$sql = "SELECT app_ref_person_submitted_by
        FROM vacancy_applications
        WHERE app_ref_vacancy = 306";

$result = $conn->query($sql);

while($row = $result->fetch_array()){
    echo $row['app_ref_person_submitted_by'];
}

$conn-> close();
?>


  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Gunakan Database Relasional MySQL di Ubuntu 9.10 (Karmic)

  2. Kode kesalahan MySQL 1235

  3. Tabel database MySQL ke tabel HTML

  4. wildcard mysql (abaikan satu/dua karakter dalam pencarian)

  5. Urutkan Array Multi-dimensi berdasarkan indeks yang diberikan - PHP?