如何从数据库获取“id”以更新特定行?

I am trying to update a row which is already in database, and i am using above code for that but it gives me error as 'undefined id', so how can i do this.....please help me!!!

if(isset($_POST['sub'])) {
    $getid="select id from login";
    $res=mysql_query($getid);
    $ids=$_GET[$row['id']];

    $about=$_POST['desc'];
    $pri=$_POST['price'];
    $ride=$_POST['fly'];
    $city=$_POST['ct'];

    $flt="";
    foreach($ride as $entry) {
        $flt .= $entry.",";
    }
    $ct="";
    foreach($city as $entry) {
        $ct .= $entry.",";
    }

    $query ="UPDATE login SET rides='$flt',price=$pri,about='$about',city='$ct' WHERE id='$ids'";

    $result = mysql_query($query);
    echo $result;
    if(!$result) {
        echo '<script language="javascript">';
        echo 'alert("something went Wrong...:("); 
        location.href="edit.php"';
        echo '</script>';
    } else {
        echo '<script language="javascript">';
        echo 'alert("successfully updated!!!"); 
        location.href="edit.php"';
        echo '</script>';
    }
}
$res=mysql_query($getid); $ids=$_GET[$row['id']];

You need to fetch the id by executing and fetching If you want all ids then you must store it in array and then implode it or concatenate in a single variable then use it in where condition of update query use IN clause

fetch the id from the database use the $conn variable to execute the query use mysqli instead of mysql

$getid="select id from login";
$res=mysqli_query($conn,$getid);
 while($row = mysqli_fetch_assoc($res))
{
$ids[]=$row['id'];
}