Kirk Y
05-30-2006, 12:50 AM
I've got messages being pulled from a database and I'm trying to create an option for the other administrators to remove the messages by clicking an image. I'm using the following code:
$blast_msg = $db->query_read("
SELECT *
FROM blastmsg
");
while ($blast = $db->fetch_array($blast_msg))
{
$user = $blast['user'];
$date = $blast['date'];
$message = $blast['message'];
$id = $blast['blastid'];
}
if ($_GET['do'] == 'delete')
{
if (!$blast = $db->query_first("SELECT blastid FROM blastmsg WHERE blastid = " . intval($_GET['id'])))
{
eval(standard_error(fetch_error('non_existant')));
}
$db->query("DELETE FROM blastmsg WHERE blastid = '$id'");
eval(print_standard_redirect('blast_del'));
}
The problem is that upon clicking the image, the wrong message is being erased.
I'm using this as the URL:
<a href='blast.php?{$vbulletin->session->vars['sessionurl']}do=delete&id=$id'>
Thanks in advance for any ideas.
$blast_msg = $db->query_read("
SELECT *
FROM blastmsg
");
while ($blast = $db->fetch_array($blast_msg))
{
$user = $blast['user'];
$date = $blast['date'];
$message = $blast['message'];
$id = $blast['blastid'];
}
if ($_GET['do'] == 'delete')
{
if (!$blast = $db->query_first("SELECT blastid FROM blastmsg WHERE blastid = " . intval($_GET['id'])))
{
eval(standard_error(fetch_error('non_existant')));
}
$db->query("DELETE FROM blastmsg WHERE blastid = '$id'");
eval(print_standard_redirect('blast_del'));
}
The problem is that upon clicking the image, the wrong message is being erased.
I'm using this as the URL:
<a href='blast.php?{$vbulletin->session->vars['sessionurl']}do=delete&id=$id'>
Thanks in advance for any ideas.