More mySQL help please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    More mySQL help please

    PHP Code:
    <?php
    $search 
    = @$_GET['query'];
    $db mysql_connect('localhost''root''');
          
    mysql_select_db('site');
    $do "SELECT * FROM sites WHERE file_name LIKE '%\"$search\"%'";
    $result mysql_query($do);


    while(
    $files mysql_fetch_array($resultMYSQL_ASSOC)){
        echo 
    "{$files['file_name']}";
    }

    echo 
    "<H2>Search Script:</H2><br />";
    echo 
    "<FORM ACTION=\"search.php\" METHOD=\"GET\">";
    echo 
    "Please Enter Search Query<br />";
        echo 
    "<INPUT NAME=\"query\" TYPE=TEXT>";
        echo 
    "<br />";
        echo 
    "<INPUT TYPE= SUBMIT VALUE=\"Search\">";
    echo 
    "</FORM>";
    ?>

    for some reason this isnt displaying any results to my browser any ideas ?

    #2
    nvm sorry i was missing some basic syntax
    PHP Code:
    <?php
    $search 
    = @$_GET['query'];
    $db mysql_connect('localhost''root''');
          
    mysql_select_db('site');
    $do "SELECT * FROM sites WHERE file_name LIKE '%".$search."%'";
    $result mysql_query($do);
        
    echo 
    "<H2>Search Script:</H2>";
    echo 
    "<FORM ACTION=\"search.php\" METHOD=\"GET\">";
    echo 
    "Please Enter Search Query<br />";
        echo 
    "<INPUT NAME=\"query\" TYPE=TEXT>";
        echo 
    "<br />";
        echo 
    "<INPUT TYPE= SUBMIT VALUE=\"Search\">";
    echo 
    "</FORM>";

    while(
    $row mysql_fetch_array($resultMYSQL_ASSOC)){
        echo 
    "{$row['file_name']}";

    }
    ?>

    Comment


      #3
      Originally posted by NoFx View Post
      nvm sorry i was missing some basic syntax
      PHP Code:
      <?php
      $search 
      = @$_GET['query'];
      $db mysql_connect('localhost''root''');
            
      mysql_select_db('site');
      $do "SELECT * FROM sites WHERE file_name LIKE '%".$search."%'";
      $result mysql_query($do);
          
      echo 
      "<H2>Search Script:</H2>";
      echo 
      "<FORM ACTION=\"search.php\" METHOD=\"GET\">";
      echo 
      "Please Enter Search Query<br />";
          echo 
      "<INPUT NAME=\"query\" TYPE=TEXT>";
          echo 
      "<br />";
          echo 
      "<INPUT TYPE= SUBMIT VALUE=\"Search\">";
      echo 
      "</FORM>";

      while(
      $row mysql_fetch_array($resultMYSQL_ASSOC)){
          echo 
      "{$row['file_name']}";

      }
      ?>
      quit using @ to suppress errors. Its fcuked up.

      Comment


        #4
        ok thanks for the advice

        Comment


          #5
          Anytime man.

          Comment

          Working...
          X