Sorry forgot to isnert the list email address. Thanks for your help. I will search prepared statement in the manual. Will post again if have next/ other questions.
Thanks a lot. -----Original Message----- From: Rhino [mailto:[EMAIL PROTECTED] Sent: Friday, November 25, 2005 12:18 PM To: mysql; asus77x Subject: Re: select command 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" <[EMAIL PROTECTED]> To: "'Rhino'" <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED] Sent: Thursday, November 24, 2005 10:05 PM To: asus77x; mysql@lists.mysql.com 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/[EMAIL PROTECTED] 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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] Send instant messages to your online friends http://asia.messenger.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]