OK im am trying to select a topic to delete before I delete it and this is what I have.
$connection = @mysql_connect(\"$server\", \"$user\", \"$password\") or die(\"Couldn\'t Connect.\");
$db = @mysql_select_db($dbname, $connection) or die(\"Couldnt select database.\");
$sql = \"SELECT * FROM events\";
$result =@($sql,$connection) or die(\"Couldn\'t ececute query.\");
while ($row = mysql_fetch_array($result)) {
$topic = $row[\'topic\'];
$id = $row[\'id\'];
$option .=\"<option value=\'$id\'>$topic</option>\";
}
$yes=\"<form method=\'post\' action=\'upcomingevents.php?page=showdelete&id=$id\'>
<font face=\'Verdana\' size=\'2\'>Please Choose An event to Delete?</font><br>
<select name=\'id\'>
$option
</select>
<br>
<input type=\'submit\' name=\'Delete\' value=\'Delete\'>
</form>\";
break;
Please note i have config.php at the top of the page. When i select a topic it should go to the confirmation page which is set up like so.
case showdelete:
$connection = @mysql_connect(\"$server\", \"$user\", \"$password\") or die(\"Couldn\'t Connect.\");
$db = @mysql_select_db($dbname, $connection) or die(\"Couldnt select database.\");
$result =@($sql,$connection) or die(\"Couldn\'t ececute query.\");
$sql = \"SELECT * FROM \'events\' WHERE id = \'$id\'\";
while ($row = mysql_fetch_array($result)) {
$topic = $row[\'topic\'];
$speaker = $row[\'speaker\'];
$date = $row[\'date\'];
$time = $row[\'time\'];
$location = $row[\'location\'];
$cost = $row[\'cost\'];
$telenum = $row[\'telenum\'];
}
$yes=\"
<table width=\'387\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\' height=\'22\' align=\'center\'><tr><td> <font face=\'Verdana\' size=\'2\'>$speaker<br>$topic<br>$date<br>$time<br>$cost<br>$location<br>
$telenum</font><br>
<br>
<a href=\'upcomingevents.php?page=delete&topic=$topic\'>Delete</a></td>
</tr>
</table>\";
break;
When i click the first page to delete confirm the delete i get id=6 (because i have 6 entrys) and i get my error couldnt execute query. Any ideas. Thanks in advance 🙂