A Digital Age Deserves A Digital Leader

SQL probems

SQL probems

Postby stuartj » Wed Sep 01, 2004 7:34 pm

Anyone know why this SQL query doesnt work?

SELECT * FROM enquirys WHERE action='1' AND WHERE record_type='1' ORDER BY id_number DESC

Thanks

Stuart
Linux Master
Currently hosting 17 Linux servers
PRO Level 2
User avatar
Posts: 33
Joined: Mon Aug 30, 2004 1:38 pm
Location: My Computer

Postby tdcrone » Thu Sep 02, 2004 11:25 am

You should be able to concatenate "where"s with an AND, not AND WHERE. I think it will work then, unless I'm missing something else. :)

Good luck,
-TC
K6-II 300MHz - PCChips M571 (ALi chipset) - S3 Virge (2MB) - Processor Fan with Attached Heat Sink - Power Supply with Onboard Fuse - 128MB 72-Pin SIMM Ram - 8GB Quantum Fireball 5.25" - 100 Mbps NIC - Redhat 7.1
PRO Level 2
Posts: 38
Joined: Thu Aug 12, 2004 2:54 pm
Location: North Carolina, USA

Postby ZeroByte » Thu Sep 02, 2004 12:41 pm

The second WHERE clause is not necessary in this query.

use this instead

Code: Select all
SELECT * FROM enquirys WHERE action='1' AND record_type='1' ORDER BY id_number DESC
ZeroByte
PRO Level 15
User avatar
Posts: 1199
Joined: Thu Aug 01, 2002 2:12 am
Location: Mexico, NY
Real Name: Mike Sheats

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron
cron