本文介绍了存储过程正在删除所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下过程:(请确保直接从MySQL Workbench提取DDL代码)

I have this procedure: (DDL code extracted directly from MySQL Workbench just to make sure)

DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `removerContacto`(nome VARCHAR(250),id INT)
BEGIN
DELETE FROM Contactos WHERE Nome = nome AND UsersID = id;
END




我这样称呼:




and I call it this way:

mysql_query("CALL removerContacto(''".$_GET[''nome'']."'',''".$_GET[''uid'']."'')");



问题是删除所有行而不是删除所有行(仅针对该WHERE子句).如果我尝试



The problem is removing all rows instead only one (there''s only for that WHERE clause). If I try

mysql_query("DELETE FROM Contactos WHERE Nome =''".$_GET[''nome'']."'' AND UsersID=".$_GET[''uid'']."");



或直接在工作台上



or directly at workbench

DELETE FROM Contactos WHERE Nome = ''someone'' AND UsersID = 1;



它可以正常工作.我在做什么错?



It works correctly. What am I doing wrong?

推荐答案




我这样称呼:




and I call it this way:

mysql_query("CALL removerContacto(''".





问题是删除所有行而不是删除所有行(仅针对该WHERE子句).如果我尝试



The problem is removing all rows instead only one (there''s only for that WHERE clause). If I try

mysql_query("DELETE FROM Contactos WHERE Nome =''".


这篇关于存储过程正在删除所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 15:21