基本的に私の質問が述べたように、phpmyadminでは機能しますが、php自体では機能しません。スクリプトを実行すると、true が返され、死ぬことはありません。ヘルプ!
クエリは次のとおりです。
DELETE FROM selections WHERE selectorID = '$userID' AND selectedID = '$ID'
phpスクリプトは次のとおりです。
<?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;
}
?>
私のデータベースは次のようになります。
id|selectorID|selectedID
3 1 4
4 1 5