Hello, i have set up a page so that it allows ppl to add and delete info from a database. My problem is that when information is added to it, it is quickly removed from it.
The page is set to refresh every 5 seconds. But that shouldn't activeate the code should it?? It's probably to do with the way i have written the code.
if(!$cdData[0]) $cdlist = "There are currently no albums listed in the database.";
else {
$cdQuery = "SELECT artist, album, genre, id FROM ".$table." ORDER BY artist, album DESC";
$cdResult = mysql_query($cdQuery, $dbLink)
or die(mysql_error());
if(!$cdResult) error(sql_error());
$cdlist = "<b>".$table."</b><br><table class=\"td\"><tr><td>Artist</td><td>Album</td><td>Genre</td></tr>";
while($cdData = mysql_fetch_array($cdResult)) {
$ID = $cdData['id'];
$cdlist .= "<tr><td class=\"td\">$cdData[artist]</td><td class=\"td\">$cdData[album]</td><td class=\"td\">$cdData[genre]</td><td class=\"td\"><a href=\"$PHP_SELF?query\">Delete</a></td></tr>";
}
$cdlist .= "</table>";
}
$query = mysql_query("DELETE FROM cd WHERE id = $ID");
include "template.php";
}
any help on this would be appreciated
Thanks in advance
Iquil