STEM
Decapat
- Katılım
- 5 Haziran 2022
- Mesajlar
- 107
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
Veri çok büyük o yüzden örnegin localhost/api.php?id=xxx yazıldıgında gelmesini istiyorum nasıl yaparım?
PHP:
<?php
$con = mysqli_connect("localhost","root","","kullanıcı");
if($con)
{
$sql = "select * from kullanıcı";
$result =mysqli_query($con,$sql);
if($result){
header("Content-Type: JSON");
$i=0;
while($row = mysqli_fetch_assoc($result)){
$response[$i]['ID']= $row ['ID'];
$response[$i]['NO']= $row ['NO'];
$i++;
}
echo json_encode($response,JSON_PRETTY_PRINT);
}
}
?>