On Mon, Mar 26, 2001 at 12:26:51PM -0700, YI,LI (HP-USA,ex1) wrote:
> Hi,
> 
> In my case, some of tables are created according to people's name, e.g.
> 
> when user adds new name:  firstname lastname
> it should create table in background =>  firstname_lastname
> 
> But problem occurs when user name contains ', e.g.  firstname's lastname, I
> had it encoded first, java.net.URLEncoder.encode(firstname's lastname) which
> turn to =>  firstname%27s_lastname, but it still gives error because of %.
> 

You can use back-quotes around table and field names. I believe it
allows you to use any characters for these names. E.g.

create table `John O'Reilly` ( ... );

The problem with this is that the mysql command line client doesn't
treat back-quotes as quoting characters, making ad-hoc queries with
this tool impossible on certain names. This alone may be enough
reason to look for another naming scheme for your tables.

Can't you use a single table with an extra field for the user name
or id? Or does each table have a unique structure?


Regards,

Fred.

-- 
Fred van Engen                              XO Communications B.V.
email: [EMAIL PROTECTED]             Televisieweg 2
tel: +31 36 5462400                         1322 AC  Almere
fax: +31 36 5462424                         The Netherlands

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to