PHP mysqli real_query() Fonksiyon
Örnek - Nesne Yönelimli stil
Tek bir SQL sorgusu yürütün. Sonucu store_result() ile saklayın:
<?php
$mysqli = new mysqli("localhost","my_user","my_password","my_db");
// Check connection
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
$mysqli -> real_query("SELECT * FROM Persons");
if ($mysqli -> field_count) {
$result = $mysqli -> store_result();
$row = $result -> fetch_row();
// Free result set
$result -> free_result();
}
$mysqli -> close();
?>
Tanım ve Kullanım
real_query() / mysqli_real_query() işlevi, tek bir SQL sorgusu yürütür. Sonuç, store_result() veya use_result() işlevleriyle alınabilir veya saklanabilir.
Sözdizimi
Nesne yönelimli stil:
$mysqli -> real_query(query)
Prosedür stili:
mysqli_real_query(connection, query)
Parametre Değerleri
Parameter | Description |
---|---|
connection | Required. Specifies the MySQL connection to use |
query | Required. The query to be executed |
Teknik detaylar
Geri dönüş değeri: | Başarı konusunda DOĞRU. Başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 5+ |
❮ PHP MySQLi Referansı