Basically as my question stated, it works on phpmyadmin but not php itself. When I run the script, it returns true, and doesn't die. HELP!
here is the query:
DELETE FROM selections WHERE selectorID = '$userID' AND selectedID = '$ID'
Here is the php script:
<?php
include_once "connect_to_mysql.php";
$errorB = false;
$error = '';
$id = '';
$userID = '';
if (empty($_GET['ID']) || empty($_GET['userID'])) {
$errorB = true;
if (empty($_GET['ID'])) {
$error = $error.'-No selected ID was sent';
}
if (empty($_GET['userID'])) {
$error = $error.'-No selector ID was sent';
}
} else {
$id = $_GET['ID'];
$userID = $_GET['userID'];
echo $id.$userID;
$sqlInsert = mysql_query("DELETE FROM selections WHERE selectorID = '$userID' AND selectedID = '$ID'") or die (mysql_error());
echo 'shz';
}
if ($errorB) {
echo $error;
}
?>
My database looks like this:
id|selectorID|selectedID
3 1 4
4 1 5