Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Missing Id parameter for delete row
30/10/2011
20:01
Avatar
nery1f
Member
Members
Forum Posts: 3
Member Since:
25/10/2011
sp_UserOfflineSmall Offline

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

30/10/2011
20:52
Avatar
nery1f
Member
Members
Forum Posts: 3
Member Since:
25/10/2011
sp_UserOfflineSmall Offline

ok,  I fix the problem whit this

if(($_POST['oper']=='del') || ($_GET['oper']=='del') )
{

    $SQL = "delete from bscit_perspectiva where CdgoPrspctva =". .$_POST['id'];

};

Laugh

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information