Page 1 of 1

mysqli_mullti_query

Posted: Mon Jan 22, 2007 5:09 am
by shwetarani
how to execute this query in mysql through php
$query="tee test.txt";
$query="select * from invoice";
$query ="notee";

i run this query through mysqli_multi_query($query) but i didn't get anything.there ia no any error.please help me
here is my code

Code: Select all

<?php 
$frm = $_SERVER['PHP_SELF'];
echo "<form name = 'form1' method= 'post' action= $frm>";
echo "<br>";

 
  $con1 =  mysqli_connect("localhost", "root", "admin","paras"); 

   if (!$con1)
   {
     die('Could not connect: ' . mysqli_errno($con1));
   }

   $sql1= " tee xyz.out;";
   $sql1= " select Name, f_id from feedback;";
   $sql1= " notee";

  
  if( mysqli_multi_query($con1, $sql1))
  {
    do
     {
       
       if ($result = mysqli_store_result($con1))
       { 
 
         while ($row = mysqli_fetch_row($result))
         {
           echo $row[0];
          // echo $row[1];
         }
         mysqli_free_result($result);
       }

       if (mysqli_more_results($con1))
        {
         echo"<br>";
        }

       }while (mysqli_next_result($con1));
     }
mysqli_close($con1);

echo "</form>";


?>

Posted: Mon Jan 22, 2007 6:30 am
by volka
$sql1= " tee xyz.out;";
$sql1= " select Name, f_id from feedback;";
$sql1= " notee";
you probably want

Code: Select all

$sql1 = " tee xyz.out;";
$sql1 .= " select Name, f_id from feedback;";
$sql1 .= " notee";