php存储过程 [英] php stored procedure
本文介绍了php存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Every body
i我是php的新手..但我现在做得很好
i有调用存储过程的问题
存储过程
Hello Every body
i am new on php .. but i do well for now
i have problem with called stored procedure
Stored Procedure
CREATE DEFINER=`root`@`localhost` PROCEDURE `spr_StdDelete`(IN ID INT)
BEGIN
DELETE FROM students WHERE ID=@ID;
END
它的工作对我的sql很好但是当我在php上调用它时删除所有行..这就是问题
i想要删除所选行
its work good on my sql but when i call it on php its delete all row .. and this is the problem
i want delete selected row
<?php
include('config.php');
if (isset($_GET['ID']) && is_numeric($_GET['ID']))
{
$ID = $_GET['ID'];
$result = mysql_query('Call spr_StdDelete("$ID")')
or die(mysql_error());
header("Location: view.php");
}
else
{
header("Location: view.php");
}
?>
和如果我使用此查询其工作并删除刚刚选定的行
and if i use this query its work and delete just selected row
$result = mysql_query("DELETE FROM students WHERE ID=$ID")
or die(mysql_error());
推荐答案
_GET [ ID'])&& is_numeric(
_GET['ID']) && is_numeric(
_GET [' ID']))
{
_GET['ID'])) {
ID =
ID =
这篇关于php存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文