Forum


20:01

25/10/2011

Hi
I have a problem pasing the id parameter for delete a row.
I have this code to create the xml
$s = "<?xml version='1.0' encoding='utf-8'?$et\n";
$s .= "<rows>";
$s .= "<page>".$page."</page>";
$s .= "<total>".$total_pages."</total>";
$s .= "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$s .= "<row id='". $row[CdgoPrspctva]."'>";
$s .= "<cell>". $row[CdgoPrspctva]."</cell>";
$s .= "<cell>". $row[Dscrpcion]."</cell>";
$s .= "</row>";
}
$s .= "</rows>";
and this for the model
colNames:['Inv No','Descripcion'],
colModel:[
{name:'CdgoPrspctva',index:'CdgoPrspctva', width:55,editable:true,editoptions:{readonly:true,size:10}},
{name:'Dscrpcion',index:'Dscrpcion', width:80,editable:true,editoptions:{size:10} }
],
and this do the add, edit and delete
$invId = $_POST['CdgoPrspctva'];
$Dscrpcion = $_POST['Dscrpcion'];
$clientId = $_POST['name'];
$amount = $_POST['amount'];
$tax = $_POST['tax'];
$total = $_POST['total'];
$note = $_POST['note'];
$ship_via== $_POST['ship_via'];
if($_POST['oper']=='edit')
{
$SQL = "update bscit_perspectiva set Dscrpcion='$Dscrpcion' where CdgoPrspctva= $invId";
};
if($_POST['oper']=='add')
{
$SQL = "insert into bscit_perspectiva values (0,'$Dscrpcion')";
//echo $SQL.'<br/>';
};
if(($_POST['oper']=='del') || ($_GET['oper']=='del') )
{
$SQL = "delete from bscit_perspectiva where CdgoPrspctva =$invId";
};
$result = mysql_query( $SQL );// or die("Ocurrieron errores durante la ejecucion.".mysql_error());
$deleted_rows = mysql_affected_rows();
if ($deleted_rows >= 1)
{
$status = "success";
$message = $deleted_rows." Registro(s) afectado(s)";
} else {
$status = "fail";
$message = "Error al realizar la peticion".'<br/>'.$SQL.'<br/>'.mysql_error();
}
$s = $status.';'.$message.';'.'';
print $s;
the add and edit work fine but the delete method dont get the id parameter, someone now why?
thanks for your help and sorry for my english
Most Users Ever Online: 715
Currently Online:
53 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66