|
|
 |
RE: FN-FORUM: MySQL Query Problems
date posted 31st January 2006 13:48
---
I agree ben
A join gives the opposite but you could run over the resulting array in =
php
or whatever and eliminate results, im a big believer in pushing as much =
work
to the parsing engine if the operation can be done that way as opposed =
to
using the DB,
ash
---
** I STRONGLY DISAGREE **
The code D wants to use to work on MySQL 3, 4 or 5 is this (subject to
typos):
SELECT ABSClients.*=20
FROM `ABSClients`=20
LEFT JOIN `ABSdocs_clients`=20
ON ABSClients.clientID =3D ABSdocs_clients.clientID
WHERE ABSdocs_clients.imageID !=3D YOUR SEARCH CONIDION HERE
A join CAN be used to eliminate results. And getting the DB engine to =
do it
will probably be optimal, especially if the tables are properly indexed.
Doing DB tasks in PHP or script just makes sites both slow, increases =
the
size of the code base, and potentially leaves the source difficult if =
not
impossible to maintain.
JOIN and LEFT JOIN are nothing to be scared of, in either understanding =
or
in DB processing overhead.
Cheers,
James
www.daltonfirth.co.uk
|
 |
|