Loading ...
Sorry, an error occurred while loading the content.

Expand Messages
  • bhatavanti
    Hi, I have written the following code in two files. but when i run these, I am getting an error : Warning: mysql_fetch_array(): supplied argument is not a
    Message 1 of 1 , Mar 3, 2010
    • 0 Attachment
      Hi,
      I have written the following code in two files.
      but when i run these, I am getting an error :
      Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hermes/bosweb/web147/b1479/d5.lciin000/public_html/gohad.info/S/searchcity.php on line 28

      Can anyone fix this?


      file1:

      <td><?php

      $cityname=$_POST['cityname'];
      $a=mysql_query("select * from city");
      echo "<tr>";
      echo "<td>";
      echo "<font size=2 face=Verdana>City :</font>";
      echo "</td>";
      echo "<td>";
      echo "<select name=cityname id=cityname1>";
      echo"<option value= >----Select City----</option>";
      while($b=mysql_fetch_array($a))
      {
      echo "<option value=".$b['cityname'].">" .$b['cityname']. "</option>";
      }
      echo "</select>";
      echo "<span id=cityname1 style=display:none;color:#FF0000>*</span>  </td>";
      echo "</tr>";

      ?> </td>

      file2:

      if($_REQUEST['fdate']!="" && $_REQUEST['date']!="" && $_REQUEST['cityname1']!="")
      {
      $view_qry = "select * from transaction where Date >= '".str_replace("/","-",$_REQUEST['fdate'])."' and Date <= '".str_replace("/","-",$_REQUEST['date'])."' and ReceivingCity = '".$_REQUEST['cityname1']." '" ;
      } /*
      else if($_REQUEST['fdate']!="" )
      {
      $view_qry = "select * from transaction where Date >= '".str_replace("/","-",$_REQUEST['fdate'])."'" ;
      }
      else if($_REQUEST['date']!="" )
      { $view_qry = "select * from transaction where Date <= '".str_replace("/","-",$_REQUEST['fdate'])."'" ;
      }else
      {
      $view_qry = "select * from transaction where ReceivingCity = '".$_GET['city']." ' ";
      }
      */

      $run_qry = mysql_query($view_qry);

      while($record = mysql_fetch_array($run_qry))
      {

      }
    Your message has been successfully submitted and would be delivered to recipients shortly.