Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: open

Message Too Old, No Replies

SQL - can't see the error

     
12:23 am on May 19, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



This is probably really simple, and I'm going to kick myself for not seeing it, but hey.

I'm trying to execute the following the following query:

 SELECT FROM jobs
WHERE active = "1"
AND (
job_title LIKE "%one%"
OR job_title LIKE "%two%"
OR job_title LIKE "%three%"
OR description LIKE "%one%"
OR description LIKE "%two%"
OR description LIKE "%three%"
)
AND salary >= "15000"
AND salary <= "20000"
AND (
region_id = "28"
OR region_id = "11"
)
AND (
industry = "38"
OR industry = "9"
OR industry = "24"
)
LIMIT 0 , 20

And MySQL is throwing this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM jobs WHERE active = "1" AND (job_title LIKE "%one%" OR job_title LIKE "%two' at line 1

As I said, I've been staring at this thing until my eyes bleed and I can't spot my error, so I was hoping someone here could chip in if they can see it?
12:35 am on May 19, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Gah, I should stop working when I'm nearly falling asleep. Damn next-day deadlines.

SELECT FROM jobs

SELECT [b]columns[/b] FROM jobs

Why is it always after you've publically humiliated yourself you realise these things? :(
3:04 pm on May 19, 2010 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hard to see errors through bloodied eyes :)
Glad you got it sorted.
5:02 pm on May 20, 2010 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Glad you got it sorted out, we've all been there. :)

Why is it always after you've publically humiliated yourself you realise these things? :(

There's a psychological effect to publishing it online -- you say to yourself, "While I wait for an answer I can think about something else." Once your subconscious mind gets ahold of it, it often finds the answer on it's own.
12:03 pm on May 21, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Aye, what I really should do is just go and do something else for 10 minutes, something mundane that takes attention but not thought.

I often find that the answer comes to me when I just give up for a few hours - but I never think of that until after it's happened :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month