我已经定义了mysql程序如下
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_subcategories`(IN path VARCHAR(255))
BEGIN
insert ignore into moodleui.z_subcategories(name, idnumber, description, status, last_processed_date)
select distinct concat(path, subject), subject, subject, 0, now() from moodleui.timetable_instructor;
-- where concat(path, subject) not in (select name from moodleui.z_subcategories);
END
现在我想用php调用这个程序。另外我想传递一个php变量作为参数而不是传递字符串。我尝试了以下但它似乎没有工作。 请帮我解决一下这个。
if(isset($_POST['path']))
{
$path=$_POST['path'];
echo $path;
mysql_query('CALL create_subcategories($path)');
}