title: call stored procedure using php
body: <p>i have written a basic stored procedure using mysql</p>
  
  <pre><code>DELIMITER // 
  
  CREATE PROCEDURE `sp_sel_test`()
  BEGIN
  
      SELECT * FROM category c;
  
  END// 
  DELIMITER ;
  </code></pre>
  
  <p>now i m calling it from php </p>
  
  <p>the php code is:</p>
  
  <pre><code>  &lt;?php
      $txt = $_GET['id'];
      $name = $_GET['name'];
  $con = mysql_connect("localhost","four","password");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("fourthes_a", $con);
  
  
  
  //$result = mysql_query("select * from new_c where name like %". $name ."% or c_name like %" . $name . "% order by name asc;");
  
  
  $result = mysql_query("call sp_sel_test()");
      if ($result === FALSE) {
      die(mysql_error());
  }
  while($row = mysql_fetch_array($result))
    {
    echo $row['category_id'] . " " . $row['c_name'];
    ?&gt;
    &lt;br /&gt;
    &lt;?php
    }
  
  mysql_close($con);
      echo $txt;
  
  ?&gt; 
  </code></pre>
  
  <p>now its giving the error</p>
  
  <p>PROCEDURE fourthes_a.sp_sel_test can't return a result set in the given context</p>