I have this code
DELIMITER $$
DROP FUNCTION IF EXISTS `GetNextID` $$
CREATE FUNCTION `GetNextID`() RETURNS INT DETERMINISTIC
BEGIN
DECLARE NextID INT;
SELECT MAX(articleID) + 5 INTO NextID FROM table_article;
RETURN NextID;
END$$
DELIMITER ;
INSERT INTO table_article ( articleID, articleAlias ) VALUES ( GetNextID(), 'TEST' );
executed OK in phpMyAdmin, but it fails when i pass this query to mysql_query PHP function/ Me guess this is because of the function and semi-colons. What do i do?