Jump to content

mysql error... help please =(


vicodin

Recommended Posts

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in (points to where my functions page.)

 

     function SearchIt($search){
if (!empty($search)){
   $search = CheckData($search);	
        $search = explode(" ",$search); 
                 mysql_select_db("mediapil_mkmdata") or die(mysql_error());
                       foreach($search as $words){
                               $query =("SELECT * FROM products WHERE MATCH(keywords) AGAINST('$words')");
                     while ($row = mysql_fetch_array($result)){
                                    echo'My product results';
}
}
}
}

anyone know why its giving that error?

 

Link to comment
https://forums.phpfreaks.com/topic/93555-mysql-error-help-please/
Share on other sites

Your not running www.php.net/mysql_query on the $query this not having a valid resource.

 

     function SearchIt($search){
if (!empty($search)){
   $search = CheckData($search);	
        $search = explode(" ",$search); 
                 mysql_select_db("mediapil_mkmdata") or die(mysql_error());
                       foreach($search as $words){
                               $query =mysql_query("SELECT * FROM products WHERE MATCH(keywords) AGAINST('$words')");
                     while ($row = mysql_fetch_array($result)){
                                    echo'My product results';
}
}
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.