I am trying to update 'company_name', 'company_add', 'price'
as primary key 'id'
but it shows me a 'something went wrong'
message along with an 'undefined id'
error. please help me!
<?php
include('data_conn.php');
if(isset($_POST['sub']))
{
$comname=$_POST['cname'];
$comadd=$_POST['cadd'];
$pri=$_POST['price'];
$query ="UPDATE login SET company_name=$comname,company_add=$comadd,price=$pri WHERE id=$id";
$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>';
}
}
?>