I have this SQL and PHP:
$articles = returndata("
SELECT
(SELECT COUNT(*) from blog_posts) as totalcount,
(SELECT COUNT(*) from comments where assetid = d.assetid) as replies,
c.name as categoryname,
d.category as categoryid,
d.assetid,
d.title,
d.postdate,
d.articlecontent
FROM blog_categories c
INNER JOIN
blog_posts d
GROUP BY d.assetid
ORDER BY postdate DESC
LIMIT " . (($page - 1) * $size) . ", " . $size
, $database);
I also have a variable, $query, which contains a multi-word query (like “hello world”) and I want to search my database with this. I have tried the correct things (I think) but it keeps returning 0.
Try this ::