Hi all , I need small help regarding calling the stored procedures in to PHP code.Actually i am able to getting values if i wrote code in the same php page, with multiple stored procedures calls.But when i call those stored procedures in functions which is in another page I am facing the problem and didn't get any error but i got warning like following [Sat Dec 08 11:31:10 2007] [error] [client 127.0.0.1] PHP Warning: mysqli::multi_query() [<a href='function.mysqli-multi-query'>function.mysqli-multi-query</a>]: Couldn't fetch mysqli in D:\\Program Files\\PHPSoftwares\\PHPSoftwares\\ApacheWebServer\\htdocs\\govind\\databaseFunction_03-12-07.php on line 78 and also I wrote code like following $mysqli = new mysqli("localhost", "root", "", "vijaya"); $res_new=array(); $Query1="";$Query="";$result1=0; $url="sciencedaily.com"; $Query1="call GetExpert_last('$url')"; echo $Query1; echo "<br/>"; $res = $mysqli->query("$Query1"); if(mysqli_num_rows($res)>0) { $row = mysqli_fetch_row($res); $res = $row[0]; $res_new[] = $row[0]; $res_new[] = $row[1]; $mysqli->close(); $Query="call GetExpert_lastvalue($res)"; echo $Query;echo "<br/>"; $result1=5; $result1=$mysqli->query("$Query"); echo "hai";echo "<br/>"; echo $result1; if(mysqli_num_rows($result1)>0) { $expert_value= mysqli_fetch_row($result1); $res_new[]=$expert_value[0]; $res_new[]=$expert_value[1]; $res_new[]=$expert_value[2]; } else $res_new[]="None"; } for($i=0;$i<count($res_new);$i++) { $strid= $res_new["$i"]; echo $strid; echo "<br/>"; }
hi, thank you for your message.But in this example first stored procedure is executed and return value but i didn't get value by calling second storedprocedure
You really need to indent and wrap your codes. I found a syntax error } else $res_new[]="None"; } Code (php): should be } else { $res_new[]="None"; } Code (php):
You are mistaken Kaizoku. The original code is correct. The closing curly bracket is for the earlier if statement: if(mysqli_num_rows($res)>0)
Hi, Thanks for ur reply, We also tried the way as you suggested by placing braces for else condition,but we are still getting the same warning message.We are facing problem while fetching results for the call of stored porcedure inside the second function.