List:General Discussion« Previous MessageNext Message »
From:Rhino Date:November 25 2005 5:17am
Subject:Re: select command
View as plain text  
You should not contact people on the MySQL list offline; all communication 
should be via the list so that everyone can benefit from the discussion.

As I said earlier, your WHERE clause does not make sense the way you 
expressed it in your first email. I explained how it should look in my first 
reply.

It is possible to have the table name be a variable in the query. However, 
this requires something that MySQL calls "prepared statements", also called 
"dynamic SQL" in some databases. You can find out how to work with prepared 
statements in the MySQL manual; just search on "prepared statement". You 
probably need Version 4.1.x in order to use prepared statements but you 
should check that in the manual to be sure.

Rhino

----- Original Message ----- 
From: "asus77x" <asus77x@stripped>
To: "'Rhino'" <rhino1@stripped>
Sent: Thursday, November 24, 2005 9:55 PM
Subject: RE: select command


Hi rhino,

Yes, I want the table name, and those two other variable are variety in the
query command.  Could you advise the correct command ?

Ps: my English is not good enough, so hope you can understand my question.

Thanks.

-----Original Message-----
From: Rhino [mailto:rhino1@stripped]
Sent: Thursday, November 24, 2005 10:05 PM
To: asus77x; mysql@stripped
Subject: Re: select command


>I have a command :
>
> SELECT * FROM reg_one WHERE 'varName' like 'varTmp' %
>
> This is made within dreamweaver mx.
>
I think there must be a typo in the statement you have provided. This syntax

is not correct; the % symbol should be inside the single quotes, not
following them. Also, you normally don't have two strings in the same WHERE
condition.  Perhaps you mean this, or something like it?

SELECT * FROM reg_one where varName like 'varTmp%'

> varName and varTmp is a textselect.
> Does anyone can help how to make "reg_one"
> Becomes to like varName or varTmp ?
>
I'm sorry but I'm not sure if I understand your question, it sounds as if
English is not your best language :-) Are you saying that you want the table

name to be a variable in your query?

Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 24/11/2005


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Send instant messages to your online friends http://asia.messenger.yahoo.com


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 24/11/2005




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 24/11/2005

Thread
LEFT JOIN not working on 5.0.16 - urgent helpTerence24 Nov
  • Re: LEFT JOIN not working on 5.0.16 - urgent helpSimon Garner24 Nov
  • Re: LEFT JOIN not working on 5.0.16 - urgent helpPeter Brawley24 Nov
  • Re: LEFT JOIN not working on 5.0.16 - urgent helpSGreen24 Nov
    • select commandasus77x24 Nov
      • Re: select commandRhino24 Nov
      • Re: select commandGleb Paharenko24 Nov
Re: select commandRhino25 Nov
  • RE: select commandasus77x25 Nov