- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 60 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Unable to delete using function [ ]
Author
Message
Sileencer
Nuke Soldier
Joined: Nov 03, 2007
Posts: 10
Posted:
Sat Nov 03, 2007 1:48 am
I'm Unable to delete using a link the link is as follow...
Code:
<a href=\"".$admin_file.".php?op=QuestDelete&questid=$questid&ok=1\">"._YES."</a>
The code is below but basically once I click on yes and refreshes and returned back to the question so in other words skipping the part of deleting..
Code:
function QuestDelete($questid, ok=0) {
if($ok) {
$db->sql_query("DELEETE FROM ".$prefix."_quest where questid='$questid'");
Header("Location: ".$admin_file.".php?op=QuestAdmin");
} else {
include("header.php");
GraphicAdmin();
OpenTable();
echo "<center><font class=\"title\"><b>"._QUESTADMIN."</b></font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "<center>"._REMOVEQUEST." $questid ";
echo "<br><br>[ <a href=\"".$admin_file.".php?op=QuestAdmin\">"._NO."</a> | <a href=\"".$admin_file.".php?op=QuestDelete&questid=$questid&ok=1\">"._YES."</a> ]</center>";
CloseTable();
include("footer.php");
}
I'll appreciate any help with this since it is probably something dumb that my noobness can't see.
spottedhog
Captain
Joined: Apr 30, 2004
Posts: 562
Posted:
Sat Nov 03, 2007 3:06 am
As the code is currently written, it does not access the database to delete anything. There should be a SQL DELETE statement somewhere...
_________________SMF-Nuke admin
SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Sileencer
Nuke Soldier
Joined: Nov 03, 2007
Posts: 10
Posted:
Sat Nov 03, 2007 12:28 pm
Sileencer wrote:
Code:
if($ok) {
$db->sql_query("DELEETE FROM ".$prefix."_quest where questid='$questid'");
isn't this doing the trick??
I know DELETE is spelled wrong i did it to be able to post here on forums...
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12349
Posted:
Sun Nov 04, 2007 12:42 am
Sileencer
Nuke Soldier
Joined: Nov 03, 2007
Posts: 10
Posted:
Mon Nov 05, 2007 10:09 pm
From a link in another function code below
Code:
<a href=\"".$admin_file.".php?op=QuestDelete&questid=$questid&ok=1\">"._YES."</a>
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12349
Posted:
Mon Nov 05, 2007 11:23 pm
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum