Jump to content

Recommended Posts

i HAVE THIS NEAT LITTLE BIT OF CODE the request data is sent from 1st page to second page with the action code

 if(isset($_REQUEST['555']) && $_REQUEST['555'] =="delete"){

@mysql_query("DELETE FROM frm_BSALE WHERE did=".$_REQUEST['delid']." and pidid ='".$_REQUEST['id']."'");
$_REQUEST['page'] = "protect";

}

it gets the request data from:

<a href="del.php?id=<? echo $row['pidid']; ?>&555=delete&delid=<? echo $row['delid']; ?>">

 

This setup works great and deletes the data.

 

I tried to change this to UPDATE THE TABLE INSTEAD of delete BUT IT WONT WORK

 

this is what i did:

if(isset($_REQUEST['555']) && $_REQUEST['555'] =="delete"){

$query_add="UPDATE `frm_bfiles` SET `pidtwo`='".$_REQUEST['pidtwo']."' WHERE `did`='".$_REQUEST['delid']."' AND `pidid` =".$_REQUEST['id'];
$result=mysql_query($query_add);
$_REQUEST['page'] = "protect";
}

 

<a href="del.php?id=<? echo $row['pidid']; ?>&555=delete&delid=<? echo $row['delid']; ?>&pidtwo=5">

 

 

Help please, also what is the @? in from of mysql_query used for? Thank you

Link to comment
https://forums.phpfreaks.com/topic/190072-sql-update-from-link/
Share on other sites

i used the original code below and substituted delete from with update and set i used a defined integer as value for update and it worked good night!

if(isset($_REQUEST['555']) && $_REQUEST['555'] =="delete"){		@mysql_query("DELETE FROM frm_BSALE WHERE did=".$_REQUEST['delid']." and pidid ='".$_REQUEST['id']."'");	$_REQUEST['page'] = "protect";	}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.