2017-03-07 65 views
-1

删除数据我有一个名为“callshopusers”不是从数据库

CREATE TABLE IF NOT EXISTS `callshopusers` (
    `id_callshopuser` int(11) NOT NULL AUTO_INCREMENT, 
    `id_callshop` int(11) NOT NULL, 
    `id_client` int(11) NOT NULL, 
    `client_type` int(11) NOT NULL, 
    PRIMARY KEY (`id_callshopuser`) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; 

Database structure

但是,当我尝试从该表中删除的数据,这是行不通的一个主表。这里的id_client列在另一个表中用作主键。 我的删除查询是:

$sql="DELETE FROM callshopusers WHERE id_callshopusers=$id"; 

但它不起作用。

回答

0

您在id_callshopusers中有一个错字,应该是id_callshopuser而不是's' $ sql =“从callshopusers删除WHERE id_callshopusers = $ id”;

+0

Ohhhhhh ......:p谢谢.....再次感谢...... –