Hi guys,
I want to call stored procedure in mysql from php code - at first glance simple task, but I met huge problems. Maybe some of you could help me.
The code is
$sql = "call my_proc('".$POST['a']."','".$POST['b']."','".$POST['c']."','".$POST['d']."')";
mysql_query($sql);
But nothing happens - just like the lines are commented.
If i add echo $sql."<br>" - just to see the string generated, it looks ok -
"call my_proc('value_for_a','value_for_b','value_for_c','value_for_d')"
If I run thios sql from mysql prompt -
mysql>call my_proc('value_for_a','value_for_b','value_for_c','value_for_d');
it works, no problems. But from php code this execution is just skipped.
The connection to mysql is ok, before trying to call the procedure, I have some insert, updates, select on the database and they work pretty well. But calling procedure fails - actually nothing happens.
I get the feeling, that I am missing some generic point. Do I need any settings or what else?
The procedure my_proc was created as root in test database. The connection to the database is also as root, so it shouldn't be a permission problem. I browsed the forums here and found out some examples, but it is exactly what I do -
mysql_connect("localhost", "root", "password");
mysql_select_db("test");
$sql = "...";
mysql_query($sql);
If $sql is something like "insert into foo values('foo')" - it works.
If $sql is "call myproc..." - it doesn't, no errors returned.
Any ideas?
Thanks in advance,