删除显示列出的表数据库中的行 [英] Delete the row at the showed listed table database

查看:85
本文介绍了删除显示列出的表数据库中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有人可以帮我解决下面列出的行的行吗?如何在此行编写代码?我想点击删除以删除特定行。


< td colspan =" 2" align =" right">删除< / td>


非常感谢


nma


[PHP]

<?php

session_start();


if(!isset($ _ SESSION [' 'user''])){

header(''Location:/ ..'');

die();

}

?>

<?php

include_once(''.. / ez_sql.php'');


if($ _ GET [''eventID''] == 0){

if(isset($ _ GET [''noteID''])){

$ noteID = $ _GET [''noteID''];

$ notes = $ db-> get_results("选择MovieNotes。*,来自MovieNotes的UserLogin.username左连接用户登录MovieNotes.userID = UserLogin.userID其中noteID = $ noteID order by noteDate desc");

}

else {

$ movieID = $ _GET [''movieID''];

$ notes = $ db-> get_results("选择MovieNotes。*,来自MovieNotes的UserLogin.username,在MovieNotes.userID上加入UserLogin = UserLogin.userID其中movieID = $ movieID order by noteDate desc");

}


}

else {


if(isset($ _ GET [''noteID''])){

$ noteID = $ _GET [''noteID''];

$ notes = $ db-> get_results(" select EventNotes。*,EventLogotes中的UserLogin.username在EventNotes.userID = UserLogin.userID上加入UserLogin,其中noteID = $ noteID order by noteDate desc"); < br $>
}

else {


$ eventID = $ _GET [''eventID''];

$ notes = $ db-> get_results(" select EventNotes。*,EventLogotes中的UserLogin.username在EventNotes.userID = UserLogin.userID上加入UserLogin,其中eventID = $ eventID order by noteDate desc");

}

}


if(count($ notes)== 0){

die();

}

foreach($ notes为$ note){

?>

< table width = 400>

< tr>

< td colspan =" 2"宽度= QUOT; 200" class =" eventEntryText">

< strong><?php echo $ note-> noteDate?> < /强> - <?php echo $ note-> username?> < br /><?php echo $ note-> noteText?>< br />

< / td>


< / tr>

< tr>

< td colspan =" 2" align =" right">删除< / td>

< / tr>

< tr>

< td colspan = QUOT; 2英寸height =" 5">< img src =" iframe-borderline.jpg"宽度= QUOT; 400" height =" 5" />< / td>

< / tr>

< / table>

< ?php

}


?> [/ PHP]

Hi all,
Could someone help me how to delete the rows for the listed row below? How do I write the codes at this line? I want to click on ''Delete'' to delete the specific row.

<td colspan="2" align="right">Delete</td>

Many thanks

nma

[PHP]
<?php
session_start();

if(!isset($_SESSION[''user''])) {
header(''Location: /..'');
die();
}
?>
<?php
include_once(''../ez_sql.php'');

if($_GET[''eventID''] == 0){
if(isset($_GET[''noteID''])){
$noteID = $_GET[''noteID''];
$notes = $db->get_results("select MovieNotes.*,UserLogin.username from MovieNotes left join UserLogin on MovieNotes.userID=UserLogin.userID where noteID=$noteID order by noteDate desc");
}
else{
$movieID = $_GET[''movieID''];
$notes = $db->get_results("select MovieNotes.*,UserLogin.username from MovieNotes left join UserLogin on MovieNotes.userID=UserLogin.userID where movieID=$movieID order by noteDate desc");
}

}
else {

if(isset($_GET[''noteID''])){
$noteID = $_GET[''noteID''];
$notes = $db->get_results("select EventNotes.*,UserLogin.username from EventNotes left join UserLogin on EventNotes.userID=UserLogin.userID where noteID=$noteID order by noteDate desc");
}
else {

$eventID = $_GET[''eventID''];
$notes = $db->get_results("select EventNotes.*,UserLogin.username from EventNotes left join UserLogin on EventNotes.userID=UserLogin.userID where eventID=$eventID order by noteDate desc");
}
}

if(count($notes) == 0) {
die();
}
foreach($notes as $note) {
?>
<table width="400">
<tr>
<td colspan="2" width="200" class="eventEntryText">
<strong><?php echo $note->noteDate?> </strong> -- <?php echo $note->username?> <br /><?php echo $note->noteText?><br />
</td>

</tr>
<tr>
<td colspan="2" align="right">Delete</td>
</tr>
<tr>
<td colspan="2" height="5"><img src="iframe-borderline.jpg" width="400" height="5"/></td>
</tr>
</table>
<?php
}

?>[/PHP]

推荐答案

_SESSION [' 'user''])){

header(''Location:/ ..'');

die();

}

?>

<?php

include_once(''.. / ez_sql.php'');


if(
_SESSION[''user''])) {
header(''Location: /..'');
die();
}
?>
<?php
include_once(''../ez_sql.php'');

if(


_GET [''eventID''] == 0){

if(isset(
_GET[''eventID''] == 0){
if(isset(

< br>

_GET [''noteID''])){
_GET[''noteID''])){


这篇关于删除显示列出的表数据库中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆