Jump to content

[SOLVED] MySQL UNION Error


Guest

Recommended Posts

What's wrong with my query here?

 

$searchQuery = "(SELECT title, content FROM pages WHERE title LIKE '%$searchString%' OR content LIKE '%$searchString%') UNION ALL (SELECT title FROM albums WHERE title LIKE '%$searchString%') UNION ALL (SELECT title FROM blogs WHERE title LIKE '%$searchString%') UNION ALL (SELECT title, content FROM posts WHERE title LIKE '%$searchString%' OR content LIKE '%$searchString%') UNION ALL (SELECT title, content FROM comments WHERE title LIKE '%$searchString%' OR content LIKE '%$searchString%') UNION ALL (SELECT title, content FROM events WHERE title LIKE '%$searchString%' OR content LIKE '%$searchString%')";

 

I keep getting an invalid query error :\

Link to comment
https://forums.phpfreaks.com/topic/114778-solved-mysql-union-error/
Share on other sites

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.