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);

I could not really understand your question

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.