Yet more search function problems....

Found a bug? Tell us!!
Post Reply
AntiGenX
Regular
Posts: 5
Joined: Fri Oct 22, 2004 6:57 am

Yet more search function problems....

Post by AntiGenX »

I searched the forums and didn't seem to find anyone with the same problem as me. (though it's possible that I missed a solution if one already exists.)

I'm running MySQL 4.0.20 and PHP 4.3.9. I've checked my database and the entries table does have an index of entry_id (FULLTEXT title body extended etc...) BUT I still don't get any returs from queries. I put an echo in the query string so I could catch the output:

Code: Select all

SELECT e.id, e.author, a.username, a.email, ec.categoryid, e.timestamp, e.comments, e.title, e.body, e.extended, e.trackbacks, e.exflag FROM s_entries e, s_authors a, s_entrycat ec WHERE a.authorid = e.authorid AND e.id = ec.entryid AND MATCH(title,body,extended) AGAINST('Judging') AND isdraft = 'false' AND timestamp <= 1098420672 GROUP BY e.id ORDER BY timestamp DESC
All seems well but alas "No Entries Found for Query Judging"
Any hints where to go from here would be greatly appreciated.
tadpole
Regular
Posts: 88
Joined: Fri Oct 08, 2004 6:20 am
Location: 33°6'4.079" North, 117°3'6.563" West
Contact:

Post by tadpole »

What does a var_dump() on the result of the query say?
AntiGenX
Regular
Posts: 5
Joined: Fri Oct 22, 2004 6:57 am

Post by AntiGenX »

OK, I dropped in a var_dump($querystring) and here's what I got...

Code: Select all

string(1039) "SELECT e.id, e.author, a.username, a.email, ec.categoryid, e.timestamp, e.comments, e.title, e.body, e.extended, e.trackbacks, e.exflag FROM s_entries e, s_authors a, s_entrycat ec WHERE a.authorid = e.authorid AND e.id = ec.entryid AND MATCH(title,body,extended) AGAINST('Judging') AND isdraft = 'false' AND timestamp <= 1098465789 GROUP BY e.id ORDER BY timestamp DESC" No Entries Found for Query Judging
tadpole
Regular
Posts: 88
Joined: Fri Oct 08, 2004 6:20 am
Location: 33°6'4.079" North, 117°3'6.563" West
Contact:

Post by tadpole »

I meant var_dump() of what serendipity_db_query($querystring) returns, which should tell you exactly what (if anything) MySQL had a problem with. Sorry for the ambiguity.
AntiGenX
Regular
Posts: 5
Joined: Fri Oct 22, 2004 6:57 am

Post by AntiGenX »

serendipity_db_query($querystring); returns 1.
AntiGenX
Regular
Posts: 5
Joined: Fri Oct 22, 2004 6:57 am

Post by AntiGenX »

OK I changed the code to var_dump(serendipity_db_query($querystring));. I'm guessing that's what you were looking for? That gives me "boot(true)"
AntiGenX
Regular
Posts: 5
Joined: Fri Oct 22, 2004 6:57 am

Post by AntiGenX »

hehe. I think was supposed to be "bool(true)" ;-)
Post Reply