Re: what problem in this sql
| From: | Joel Colombo | Date: | Wed, 12 Mar 2003 09:50:14 +0000 |
| Subject: | Re: what problem in this sql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139250@lists.php.net to get a copy of this message | ||
oh and i just noticed u want to select the 'type_id' twice... i assume from
each table SO u need to...
SELECT table1.type_id AS t1_type_id, table2.type_id AS t2_type_id FROM t1,
t2
use the 'AS' function it helps with a lot of headache later... trying to
figure out y u get the wrong index !
Joel
"Alawi" <albaity@yahoo.com> wrote in message
news:20030312092215.64432.qmail@web10010.mail.yahoo.com...
> SELECT type_id, type_name, cont_id, type_id, cont_title, cat_id,
cat_name
> FROM cont_data, cont_cats, cont_types
> WHERE contdata.cont_id = $cont_id
> AND cont_data.type_id = cont_types.type_id
> AND cont_data.cat_id = cont_cats.cat_id
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online