Jump to content

priest_004

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by priest_004

  1. Ok folks,

     

    I have sorted the FATAL ERROR now it is telling me..

     

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in X:\xampp\htdocs\search.php on line 8

     

    I think I might just have to go back to the drawing board for this one....

     

    any clues on this?? code now reads..

     

    
    <?php
      
      mysql_connect ("localhost", "user", "password") or die (mysql_error());
      mysql_select_db ("it_homehelp_test") or die (mysql_error());
      
      $term = $_POST['term'];
      $sql = mysql_query("select * from it_homehelp_test where ClientName1 like '%term%' "); 
      while ($row = mysql_fetch_array($sql)){
      	echo 'Client Name' .$row['ClientName1'];
    echo 'Address' .$row['Address1'];
    echo 'Phone' .$row['Tel1'];
    }
    ?>
    
    

     

  2. Hi Dan, and Rifts,

     

    I see it, I missed the " from the front and end... dough!!

     

    thanks for pointing that out.

     

    ---------------------------------------

     

    ok new problem... now it says...

     

    Fatal error: Function name must be a string in X:\xampp\htdocs\search.php on line 7

     

    I thought it was a string.

    this is starting to hurt my head now... Same line..

     

    ???

    what have i missed this time?

  3. Hi folks,

     

    I am a complete n00b at php and mysql. I am teaching myself from books and the WWW, but alas I am stuck...

     

    the error I get is:

    Parse error: syntax error, unexpected T_STRING in X:\xampp\htdocs\search.php on line 7

     

    here is the code:

     

     

    
    <?php
      
      mysql_connect ("localhost", "user", "password") or die (mysql_error());
      mysql_select_db ("it_homehelp_test") or die (mysql_error());
      
      $term = $_POST['term'];
      $sql = $mysql_query(select * from it_homehelp_test where ClientName1 like '%term%');   <<<------this is line 7
      while ($row = mysql_fetch_array($sql)){
      	echo 'Client Name:' .$row['ClientName1'];
    echo 'Address:' .$row['Address1'];
    echo 'Phone:' .$row['Tel1'];
    }
    ?>
    
    

     

    Any help you can offer would be great. I can also post the ".html" file that creates the search bar if it is needed.

     

    Thanks

    :)

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.