Here's my code:
<?php
$product_id = $_GET['id'];
if($connect = mysqli_connect('localhost','root','','accounting')){
$sql = "SELECT * FROM inventory WHERE product_id='$product_id'";
$query = mysqli_query($connect,$sql);
mysqli_free_result($query);
mysqli_close($connect);
}else{
print "Connection failed";
}
while ( $fetch = mysqli_fetch_object($query) ) {
print $fetch->id;
}
?>
i don't know why my code doesn't work !, it seems correct. help me guys :)