Regarding calling stored procedures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

    We are working on php and mysql database.We actually implemented 
stored procedures in the php.

Here is sample example we created.

<?php
		$mysqli = mysqli_connect
("localhost", "root", "abcd", "empdb");
		$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();
			//$res=NULL;
	       *********$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/>";
	}
	

?>

In the above sample example we are able to execute the first call of 
stored procedure.But it is showing warning message when we try to 
call the line "*****" above(calling second stored porcedure).It is 
showing warning message as 
"PHP Warning:  mysqli::query() [<a href='function.mysqli-
query'>function.mysqli-query</a>]: Couldn't fetch mysqli
".We tried different ways can't able to solve this problem.

If any one knows how to solve this.Please help us.

Thanking u all.

 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux