CODE
$name = "****";
$password = "****";
$database = "****";
$mysqli = new mysqli("localhost", $name, $password, $database);
if (strcasecmp($_GET[cmd], "delete")) {
$mysqli->query("DELETE FROM tickets WHERE ticketno=".$_GET[id]);
}
$mysqli->close();
$password = "****";
$database = "****";
$mysqli = new mysqli("localhost", $name, $password, $database);
if (strcasecmp($_GET[cmd], "delete")) {
$mysqli->query("DELETE FROM tickets WHERE ticketno=".$_GET[id]);
}
$mysqli->close();
Ok, so this is half the code to a ticket management system I am building, and when I load the page, the whole table is cleared. No GET values, just the normal load of the page.
Before it would display the table's contents (in the other half of the code), but couldn't delete.
I am new to SQL databases and none of my friends have used it.