Hello friends..
Help me out..!!
this is my Procedure..which working fine in mysql...!!
DELIMITER $$
DROP PROCEDURE IF EXISTS `myp`.`insert_1`$$
CREATE PROCEDURE `myp`.`insert_1`(gname varchar(30),userid int,classtype int )
BEGIN
if exists (SELECT * FROM 0_groups where groupName=gname AND USER_ID IN(userid,'0')) then
SELECT 1 as error;
else
insert into 0_groups(groupName,classType,user_id)values(gname,classtype,userid) ;
select 2;
end if;
END$$
DELIMITER ;
but when i call it php.. it does not work..!!
$query="call insert_1('$gname','$userid','$gtype')"; $result=mysql_query($query) or die('query error'.''.mysql_error());
$count=mysql_num_rows($result) ;
if($count < 0)
{
header('location:group.php?q=4');
}
else
{
header("Location:group.php?q=1");
}
where i am making mistake..?? help me out..!! plzz..!!