Delete database entry script doesn't run, WHAT CAN BE WRONG?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Sheppard1977
Forum Newbie
Posts: 2
Joined: Sun Apr 06, 2003 7:11 pm

Delete database entry script doesn't run, WHAT CAN BE WRONG?

Post by Sheppard1977 »

I've written this simple script to erase a database entry from my MySQL database:

<?
include "connect.php";

echo("<html><body bgcolor=\"FFFFFF\" link=\"#6666FF\" alink=\"red\" vlink=\"#6666FF\">
<font face=\"Verdana\" size=\"3\">");

//delete section
if($delete==yes){
$action = mysql_query("delete from nuke_events where eid='$id'");
echo("\"$oldname\" has been removed.");
$delete='no';
echo("<form action=\"$PHP_SELF\"> <input type=submit value=\"BACK\"></form>");
}else{
echo("<p><b>In this screen Conference Room Calendar events can be erased</b></p>");
echo("<font color=red><b>CAUTION!</b></font> This will permanently delete this record from the database!</p>");
$list = mysql_query("SELECT * FROM nuke_events order by eid");
$count = mysql_num_rows($list);
$i = 0;
echo("Currently we have $count event(s) posted.");
while ($i < $count){
$id = mysql_result($list, $i, eid);
$TitleEvent = mysql_result($list, $i, title);
$DateEvent = mysql_result($list, $i, eventDate);
$TimeStart = mysql_result($list, $i, startTime);
$TimeStop = mysql_result($list, $i, endTime);

echo("
<form action=\"$PHP_SELF\"><pre><input type=hidden name=id value='$id'><input type=hidden name=delete value='yes'><input type=hidden name=oldname value='$TitleEvent'>
<b> - $TitleEvent, $DateEvent, $TimeStart</b> <input type=submit value=\"DELETE\"></form></pre>
");

$i++;
}
}

//Close mysql connection
mysql_close ($link);

?>

My problem is: this script DOES run at my webserver BUT, this script DOESN'T run at my laptop, running Win2k, Apache 1.3, MySQL and PHP Version 4.2.2. This is all self-configured.

PLEASE HELP ME, WHAT CAN BE WRONG?? I think it can be the PHP version, maybe my httpd.conf file. Or maybe somebody has a script for me that DOES WORK.

Rob
Last edited by Sheppard1977 on Thu Aug 16, 2007 4:48 pm, edited 1 time in total.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Sheppard1977
Forum Newbie
Posts: 2
Joined: Sun Apr 06, 2003 7:11 pm

Thanks

Post by Sheppard1977 »

Thanks. It's working now :D
Post Reply