Jump to content

[SOLVED] MATCH AGAINST error. MySQL says its fine!


fri3ndly

Recommended Posts

Hi all

 

I recently encountered the following error:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in \includes\DbConnector.php on line 52

 

The error cause is this mysql query when getting the number of rows (which works for other queries that do not use Match and against:

 

$posts_query = "SELECT * FROM posts WHERE MATCH (post_title, post_description, post_location) AGAINST ('$get_search') ORDER BY post_title ASC" or die(mysql_error());

$posts_row_no = $conn->getNumRows($posts_query);

 

When I run this through SQL (replacing the variable with desired text) in PHPMyAdmin it returns one row which is why I cannot understand the code not working.

 

Any help please?

 

Thanks

Xurion:

 

I know thats what is strange.

 

It echoes out this:

 

SELECT * FROM posts WHERE MATCH (post_title, post_description, post_location) AGAINST ('funky') ORDER BY post_title ASC

 

DarkWakter

 

Thanks for the reply. The query execution is done in the DbConnector file so that I can just use functions for callking things to make it easier

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.