我尝试通过从提交表单接收$delwebsite, $delusername, $delpassword
来删除我的表格行。然后我有一个(工作)sql表达式$sqlselect
,我得到了行的id。
问题:
"解析错误:语法错误,意外' $ id' (T_VARIABLE)"当我尝试 执行$ sqlselect并将结果保存在$ id。
我认为这是一个非常简单的问题,但我无法找到它。
<?php
IF(ISSET($_POST['delete']))
{
$delwebsite = $_POST['delWebsite'];
$delusername = $_POST['delUsername'];
$delpassword = $_POST['delPassword'];
$sqlselect = "SELECT id FROM $loc_username WHERE website = $delwebsite AND username = $delusername AND password = $delpassword";
$id = mysql_query($sqlselect);
$sqldelete = "DELETE FROM $loc_username WHERE id = $id";
if(mysql_query($sqldelete)){
.......
}
}
&#13;