Very Urgent need , Regarding functions in php

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

 



Hi All,
I need small help regarding muliple functions.I have created 19 functions.In each function we need to stored procedures .We are new to php code and I searched in google for multiple function with stored procedures but i didn't find any where.For this I wrote code like following


  <?php
  global $db;
  $db=new mysqli("localhost" ,"root"," vijaya"," vijaya");
  ?>
  In samplefun.php page
  
  <?php
  require_once( "connection. php"); 
  require_once( "function_ 26.php");
  $url="www.scienceda ily.com";
  
  $rate=Getrating( $url);
  echo $rate;echo "<br/>";
  $assigned=GetAssign edvalue($ url,$rate) ;
  echo $assigned;
  ?>
  
  in function_26. php page
  
  <?php
  
  function Getrating($url)
  {
  global $db;
  $stmt=$db->prepare( "call rating('$url' )");
  mysqli_stmt_ execute($ stmt);
  $result=$stmt- >bind_result( $rating);
  mysqli_stmt_ fetch($stmt) ;
  $stmt->close( );
  return $rating;

  
  }
  function GetAssignedvalue( $url,$rating)
  {
  global $db;
  $stmt=$db->prepare( "call Get_Assigned_ value('$url' ,$rating) ;");
  mysqli_stmt_ execute($ stmt);
  $result=$stmt- >bind_result( $assigned) ;
  mysqli_stmt_ fetch($stmt) ;
  $stmt->close( );
  return $assigned;
  }
  
  ?>
  When I executed and run it ,we got following error.Please help us.I got error at red colour text.


  Here is Error We got:
  
 [Thu Dec 27 12:03:44 2007] [error] [client 127.0.0.1] PHP Warning: mysqli_stmt_ execute() expects parameter 1 to be mysqli_stmt, boolean given in F:\\Softwares\ \php\\htdocs\ \samples\ \function_ 26.php on line 19
 [Thu Dec 27 12:03:44 2007] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function bind_result( ) on a non-object in F:\\Softwares\ \php\\htdocs\ \samples\ \function_ 26.php on line 20
  



Thanks in advance

vijaya

       
---------------------------------
 Meet people who discuss and share your passions.  Join them now.

[Non-text portions of this message have been removed]


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

  Powered by Linux