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>';
}
}