0

Hi all, Can somebody help me out in this as this is very urgent for me..

I want to append 2 $_get variables in a single update query so that i can assign some items to the latest inserted item

Following is the code I am using..


$insert = "INSERT INTO `farmlogin` (`uid`, `name`, `gender`, `date`, `age`, `bb`, `htno`, `htunit`, `lno`, `lunit`, `pric`, `clr`, `insured`,
`inscomp`, `polname`, `premiumtype`, `premiumamt`, `insstdate`, `matdate`, `remk`) VALUES ('$d', '$n', '$gen', '$dt', '$umar', '$bo', '$hgt', '$unitht', '$lgt', '$unitl', '$pr', '$colo', '$check', '$cname', '$poly', '$premtype', '$amt', '$insurancedat', '$mat', '$rk')";
$result = mysql_query($insert);

$latest = mysql_insert_id();//to get the latest inserted aoutoincremented id from the table

$id = intval($_GET);
$v = intval($_GET);
$sql = "UPDATE `farmlogin` SET `doc`='$id', `vend`='$v' WHERE `cowid` = '$latest'";
echo "$sql";
$data = mysql_query($sql);

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by theausum
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.