开发者

Error with code

开发者 https://www.devze.com 2023-03-01 02:50 出处:网络
I want to take actions using button. That is if I press edit or delete button user navigate to action.php page. Where my delete or edit query is written. I have navigated using POST method to action.p

I want to take actions using button. That is if I press edit or delete button user navigate to action.php page. Where my delete or edit query is written. I have navigated using POST method to action.php

action.p开发者_JS百科hp

$remove = $_REQUEST['remove'];
if(isset($_POST["remove"])) {
$sql = "DELETE FROM t_s_list WHERE `s_id` ='$remove'";
mysql_query($sql);
    $NEW="This records is Deleted";
    //header("location: manage_song.php?msg=$NEW");
}

Bit confused that what value is to be passed to compare it with field s_id


probably be an integer value corresponding to the primary key of the table, i am assuming..


print the $_REQUEST['remove']; and see the out put you can see the passing value


if (isset($_POST["remove"]))
{
 $remove = mysql_real_escape_string($_POST["remove"],$link);
 $sql = "DELETE FROM t_s_list WHERE s_id ='$remove'";
 mysql_query($sql,$link);
 $NEW="This records is Deleted";
//header("location: manage_song.php?msg=$NEW");
}
else if (isset($_POST["edit"]))
{

}
else
 echo 'Invalid Request !';
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号