PHP/SQL error, totally lost
Posted: Tue Nov 17, 2009 7:00 am
Hi ya guys. Still new here but I've been doing my part and helping out where I can, and you all have been vary helpful so far.
So here we go.
I've ran into problem while trying to get fulltext to work with sql. I was thinking some fresh eyes would point out my mistake.
and I get
Weird thing is when i echo(or print) the $sql and run that in sql, it works just fine. I'm not sure if it's a sql problem or i'm using the wrong php-mysql function.
Thoughts? And thanks for taking a look at this.
So here we go.
I've ran into problem while trying to get fulltext to work with sql. I was thinking some fresh eyes would point out my mistake.
Code: Select all
<?
$sql = "SELECT *, MATCH(search) AGAINST('".$search."' IN BOOLEAN MODE) AS score FROM testtable WHERE MATCH(search) AGAINST('".$search."' IN BOOLEAN MODE)";
while($sql2 = mysql_fetch_array($sql)) {
//output here
}
?>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/pages/fulltext.php on line 65
Thoughts? And thanks for taking a look at this.