For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2007 > MySQL 3.x and SELECT / WHERE









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MySQL 3.x and SELECT / WHERE
lallous

2007-04-04, 6:58 pm

Hello

I have a small MySQL query like this:

code:
SELECT CONCAT(users.description, ' ', users.address) AS x FROM users WHERE x LIKE '%something_to_match_here%'


MySQL 3.x is complaining about complaining about the use of "x" saying
that it is not a valid column name. Is there is a way to make this
work or something similar?

--
Elias

Sean

2007-04-04, 6:58 pm


"lallous" <lallous@lgwm.org> wrote in message
news:1175697591.472528.25070@w1g2000hsg.googlegroups.com...
> Hello
>
> I have a small MySQL query like this:
>
>
code:
> SELECT > CONCAT(users.description, ' ', users.address) AS x > FROM > users > WHERE > x LIKE '%something_to_match_here%' > >

>
> MySQL 3.x is complaining about complaining about the use of "x" saying
> that it is not a valid column name. Is there is a way to make this
> work or something similar?
>
> --
> Elias
>



I think that it should be...

SELECT CONCAT(users.description, ' ', users.address) AS x
FROM users
HAVING x LIKE '%something_to_match_here%'




ZeldorBlat

2007-04-04, 6:58 pm

On Apr 4, 10:39 am, "lallous" <lall...@lgwm.org> wrote:
> Hello
>
> I have a small MySQL query like this:
>
>
code:
> SELECT > CONCAT(users.description, ' ', users.address) AS x > FROM > users > WHERE > x LIKE '%something_to_match_here%' > >

>
> MySQL 3.x is complaining about complaining about the use of "x" saying
> that it is not a valid column name. Is there is a way to make this
> work or something similar?
>
> --
> Elias


SELECT
CONCAT(users.description, ' ', users.address) AS x
FROM
users
WHERE
CONCAT(users.description, ' ', users.address) LIKE
'%something_to_match_here%'

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com