作者chan15 (ChaN)
看板Database
标题[SQL ] MySQL procedure 在 php 可以取值吗
时间Fri Sep 2 13:45:24 2011
假设我今天写了个 procedure 叫 test()
delimiter $$
drop procedure if exists test||
create procedure test()
begin
select * from table;
end
$$
delimiter ;
我知道在 php 呼叫的方式是
$query = mysql_query('call test()');
但我想要的是这个结果就像我下 query 一样让我可以 fetch
$sql = "select * from table";
$query = mysql_query($sql);
$row = mysql_fetch_assoc($query);
do (
xxxx
while($row = mysql_fetch_assoc($query));
请问该怎麽做呢?
※ 编辑: chan15 来自: 220.134.11.173 (09/02 13:50)