stored procedure .. how to pass variable.?
Posted: Mon Jun 23, 2008 11:22 pm
Code: Select all
delimiter |
create procedure totalmonth(btnid int, mnth int)
begin
select count(click) as total from eachclick where date like "%-mnth-%" and btn=btnid;
end
|
delimiter;eachclick
+--+---+----+--------------+
|bil |btn|click|date |
+--+----+----+--------------+
|1 | 2 | 1 | 2008-05-01 |
+--+---+----+--------------+
so i create a stored procedure in my database... the thing is.. how do i pass mnth value to the query in procedure...
when i use
call totalmonth(2,05);
result will return column total with 0 value...
so how does i make this functioning..