I know somebody already answered this but for some reason their given syntax is not working for me. I am trying to fetch a radio button value from the database and display it in a radio button too. I watched many tutorials and red threads about this but it's still not working. Can you guys double check what is wrong with my code? Thank you.
This is how I fetch the value
.
<label>2-3 meters
<input type="radio" name="meter" value="2-3 Meters"
<?php
if($ssh== "2-3 Meters"){
echo "checked"; }
?>>
</label>
<label>1-2 meters
<input type="radio" name="meter" value="1-2 Meters"
<?php
if($ssh== "1-2 Meters"){
echo "checked"; }
?>>
</label>
<label>< 1 meter
<input type="radio" name="meter" value="< 1 Meter"
<?php
if($ssh== "< 1 Meter"){
echo "checked"; }
?>>
</label>
And this is my PHP
<?php
$con=mysqli_connect("localhost", "root", "", "db");
$edit=$_GET['id'];
$select="SELECT * FROM table WHERE id='$edit'";
$run=mysqli_query($con,$select);
$row=mysqli_fetch_array($run);
$id = "";
$ssh = "";
if(isset($_GET['ssh'])){
$ssh = $_GET['ssh'];
}
?>