日期:2014-05-16  浏览次数:20867 次

mysql调用存储过程返回值,求大神
存储过程:
BEGIN
  DECLARE countj INT; -- 临时存储重复UID总数
  DECLARE i INT; -- 临时循环变量存储 
  DECLARE days INT;
  DECLARE game varchar(50);
  SET i=1;
  SELECT count(DISTINCT(days)) INTO countj FROM `count_serverinfo` WHERE gameid = '",game,"';
  SELECT days INTO days FROM `count_serverinfo` WHERE gameid = '",game,"' GROUP BY days asc ;
WHILE i <= countj DO
BEGIN
SELECT game,serverorder,serverid,MAX(IF(days='",days,"',amountcount,0.00)) AS '",days,"' FROM count_serverinfo GROUP BY serverid ORDER BY serverorder DESC;
END;
SET i = i +1;
  END WHILE;
END


我应该怎么在php文件中调用勒?上网查了一下,用网上的调用方法但是不成功,第一次弄存储过程,求指教,我感觉我写的存储过程也有问题,我该怎么办

------解决方案--------------------
完整代码是什么,参数数目不对?
------解决方案--------------------
diyi 函数定义中不是两个参数,你需要检查一下。