I am having a problem please HELP ... FULL TEXT SEARCH

Discussion in 'PHP' started by romioaa, Apr 2, 2011.

  1. #1
    Hi,

    I am having a big problem with my code:



    This is for index.php

    
    <body>
    <div id="apDiv3">
    <div align="center">
    <p><span class="style8">JOUTUBE</span><br />
    <span class="style5">The Number One Video Engine</span></p>
    <form id="form" name="form1" method="GET" action="search.php">
    <label> Search a Video
    <input name="search_video" type="text" id="search_video" size="50" />
    </label>
    <label>
    <input type="submit" name="submit" id="submit" value="Submit" />
    </label>
    <span class="style7"><a href="submit.php">Submit Video </a> </span>
    <br />
    <span class="style9">Home - Latest Videos- Contact Us</span>
    </form>
    <p>&nbsp;</p>
    </div>
    </div>
    <div id="apDiv5">
    
    Code (markup):

    This is for search.php



    
    
    <?php
    $search2= $_GET['search_video'];
    
    
    $query = "
    SELECT * FROM submission_form
    WHERE MATCH(video_title, video_description) AGAINST ('$search2')
    ";
    $sql = mysql_query($query);
    
    
    while($row = mysql_fetch_array($sql)) {
    echo "<tr><td>{$row['video_title']}</td>";
    echo "<td>{$row['video_description']}</td>";
    echo "</table>";
    }
    
    Code (markup):


    I am getting this error:

    
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\joutube\search.php on line 26
    
    Code (markup):
     
    romioaa, Apr 2, 2011 IP
  2. zeekapitein

    zeekapitein Active Member

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #2
    $search2 is empty .. the post function in the first post is wrong
     
    zeekapitein, Apr 2, 2011 IP
  3. drewtoby

    drewtoby Well-Known Member

    Messages:
    763
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Yes, just redirect to the file's location (or change location and name, then point there)
     
    drewtoby, Apr 2, 2011 IP