query with SQL UNION - help
From: leegold2 (leegold_at_nospam.net)
Date: 10/17/04
- Next message: Martin: "ob_start and a callback function in a class?"
- Previous message: red: "showing mysql fields as NULL"
- Next in thread: Andy Hassall: "Re: query with SQL UNION - help"
- Reply: Andy Hassall: "Re: query with SQL UNION - help"
- Reply: Steve: "Re: query with SQL UNION - help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 17 Oct 2004 20:18:39 GMT
I'm trying to get this to work, it will compile with "php -l" but the
search is broken. What's wrong? I have MYSQL 4.1. Thanks
$result = mysql_query("SELECT p.page_url AS url, p.title AS title,
p.descrip AS descrip, p.page_id AS id
FROM page p, word w, occurrence o
WHERE p.page_id = o.page_id AND
w.word_id = o.word_id AND
w.word_word LIKE '%$keyword%'")
UNION
(SELECT p.page_url AS url, p.title AS title,
p.descrip AS descrip, p.page_id AS id
FROM page p
WHERE p.descrip LIKE '%$keyword%'");
GROUP BY p.page_id
ORDER BY p.page_id DESC" );
- Next message: Martin: "ob_start and a callback function in a class?"
- Previous message: red: "showing mysql fields as NULL"
- Next in thread: Andy Hassall: "Re: query with SQL UNION - help"
- Reply: Andy Hassall: "Re: query with SQL UNION - help"
- Reply: Steve: "Re: query with SQL UNION - help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]