I am working on this problem to get product_id from user on the base of what user select the product, code is here below
$sql = "SELECT product_title,product_id FROM products";
$result = mysqli_query($conn,$sql);
echo "<select name='get_id' id='get_id' action='dropdown.php' style='width:300px;'>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value=".$row['product_id']."'" . $row['product_title'] ."'>" . $row['product_title'] ."</option>";
}
echo "</select>";
$get_id=$_REQUEST['get_id'];
echo $get_id;
mysqli_close($conn);
}
i need to save seelcted product id in get_id variable of php
how can i solve this problem?