This query makes never gets done... and it keeps a thread open in the processlist for a long time!!! Very annoying!
| From: | Trond Erling Hundal | Date: | Wed, 24 Jan 2001 13:53:51 +0000 |
| Subject: | This query makes never gets done... and it keeps a thread open in the processlist for a long time!!! Very annoying! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6129@lists.php.net to get a copy of this message | ||
This query can sometimes draw back the whole database causing some, or all,
data that is extracted from the database to not show.
Can u experts scan through this for me?
I really need some help!
----------------------------SQL---------------------------------------------
------
SELECT DISTINCT $this->artikkeltbl.artikkelid as artikkelid,
$this->artikkeltbl.tittel as tittel,
$this->artikkeltbl.hovedingress as hovedingress,
$this->artikkeltbl.dato as dato
# Selects different parts of newsarticles: id field, date, title, toptext
and main text
FROM $this->artikkeltbl, $this->relasjonstbl
# from two different tables the article table and the relation table
WHERE $this->artikkeltbl.tittel LIKE '%$sqlx%'
OR $this->artikkeltbl.ingress LIKE '%$sqlx%'
OR $this->artikkeltbl.hovedingress LIKE '%$sqlx%'
OR $this->artikkeltbl.brodtekst LIKE '%$sqlx%'
# var $sqlx is the search string varying from page to page.
AND $this->artikkeltbl.artikkelid = $this->relasjonstbl.artikkelid
# Relation to the relation table
AND $this->relasjonstbl.portalid = $portalid
# Only selects articles within a spesific category.
ORDER by artikler.dato DESC LIMIT $x2,$x1
# u know...
----------------------------SQL---------------------------------------------
------
I have divided the website into different portions, and assigned them with
unique id`s ($portalid).
I am trying to search through articles that are only assosciated with that
spescific portalid.
What am I doing wrong?
This is meant to be a simple search utility on the page.