What is the problem?
I want to display data from database but something is wrong with code
Someone said that mysql_quety doesn't work in PHP 7
OK then How i can fix it?
<?php
if (isset($_GET['id'])) {
include('database_connection.php');
$id = preg_replace('#[^0-9]#i', '', $_GET['id']);
$sql = mysql_query("SELECT * FROM shoes WHERE id='$id' LIMIT 1");
$productCount = mysql_num_rows($sql);
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$model_name = $row["model_name"];
$price = $row["price"];
$brand = $row["brand"];
$color = $row["color"];
$type = $row["type"];
}
} else {
echo "That item does not exist.";
exit();
}
} else {
echo "Data to render this page is missing.";
exit();
}
mysql_close();
?>