I wanna be able to search both title and bookid from the database,
I know i can use this to search for title
SELECT bookid,title
FROM " . TABLE_PREFIX . "book
WHERE title LIKE '%$query%'
ORDER BY DESC
LIMIT 1
and use this to search for book
SELECT bookid,title
FROM " . TABLE_PREFIX . "book
WHERE bookid LIKE '%$query%'
ORDER BY DESC
LIMIT 1
But how do i combine them into just 1?
Thanks
I know i can use this to search for title
SELECT bookid,title
FROM " . TABLE_PREFIX . "book
WHERE title LIKE '%$query%'
ORDER BY DESC
LIMIT 1
and use this to search for book
SELECT bookid,title
FROM " . TABLE_PREFIX . "book
WHERE bookid LIKE '%$query%'
ORDER BY DESC
LIMIT 1
But how do i combine them into just 1?
Thanks
Last edited:








