I’m calling a stored procedure which takes 3 parameters (1 IN, 2 OUT) through PHP. I pass the following string set "1,2,3,4" to PHP from JavaScript using :
xmlhttp.open("GET","gethint.php?q="+str,true);
xmlhttp.send();
From PHP I get the string and call it like this (after making all proper SQL connections etc):
$q=$_GET["q"];
$result = mysql_query("CALL mst2($q, @eset, @leng)");
The error I get is Invalid query: Incorrect number of arguments for PROCEDURE fall12018.mst2; expected 3, got 6
If I remove @eset and @leng I still get the error but with 4 instead of 6, it seems that the procedure is reading in each comma separated member as a separate input, does anybody know how to send the entire set as a single argument?
Seems like right now your call looks like this (6 params, due to the commas in the value of
$q):Try encasing $q in quotes.
Which will result in this (3 params):