Hi all
I have a little script im building for online wars (Gaming)
Anyway from the php pages you can add to the DB and retrieve info from it, but wnat you cant do is delete it?...... if spent 2 days now trying to figuire this out ,and i now fear for the saftey of my comupter and of the window it may be flying out off
Code:
<?php require('../config.php');
$db = "$db_name";
$cid = mysql_connect($db_host,$db_username,$db_password);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }
if ($task=="del") {
$SQL = " DELETE FROM ca_war ";
$SQL = $SQL . " WHERE id = $id ";
mysql_db_query($db, $SQL, $cid);
}
?>
<html>
<body bgcolor="000000">
</body>
<head>
</center>
<?
$SQL = " SELECT * FROM ca_war ";
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
echo ("<P><TABLE CELLPADDING=4>\n");
while ($row = mysql_fetch_array($retid)) {
$clan = $row["clan"];
$id = $row["id"];
echo ("<TR>");
echo ("<TD><font color=ffffff>$clan</TD>\n");
echo ("<TD><A HREF=\"remove.php?id=$id&task=del\">Delete</A></TD>");
echo ("</TR>");
}
echo ("</TABLE>");
}
?>
</HTML>
As i say i really cant see why its not working, its re loading itself and the browser then reads correct
Example http://www.limaservices.com/nochex/a...?id=3&task=del so it should have deleted it.....
Im prob looking to hard now so il throw it to you guys if i may
Thanks
Mark
|