创建表 - 不能 [英] creating table - can't

查看:34
本文介绍了创建表 - 不能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经读完了,特别是在mysql.com上看看表名是否有任何

限制,一个是64个字符而另一个似乎是

表格名称不能只存在数字。


因此,在PHP中我尝试创建一个名为12345-name的表格;并且它完全失败




它让我感到困惑,因为它应该可以根据mysql

手册。

当然,表格定义如下所示。如果我将

tablename更改为仅name ..然后我可以在Mysql下创建表格

4.0.11a。

但是我希望我的表名由faxnumber-name组成,没有别的。


有什么我错过的地方阻止我做我想要的东西吗?


我在这里很困惑。 ..


/ Andreas


-

Registeret Linux用户#292411

解决方案

对我来说很好用...只是用phpMyAdmin尝试过...尝试不使用引号,

或单引号?然后我再次相信我对MySQL 3.X ...也许那就是

呢?

-Eric Kincl


Andreas Paasch写道:


我已经阅读过,特别是在mysql.com上看看是否有任何对表名的限制,一个是64个字符,另一个似乎是表格名不能只存在数字。

因此,在PHP中我尝试创建一个名为12345-name的表格。它完全失败了。

根据mysql
手册,它让我感到很困惑。
当然,表定义应该遵循它。如果我将
表名更改为仅名称 ..然后我可以在Mysql下创建表格
4.0.11a。
但我希望我的桌面名称包含faxnumber-name,没有别的。

我有什么遗漏的吗?某个地方阻止我做我想要的事情?

我在这里很困惑......

/ Andreas




2003年11月10日星期一23:39:34 +0100,Andreas Paasch< An ***** @ Paasch.Net>写道:

我已经阅读过,尤其是在mysql.com上,看看表名是否有任何限制,一个是64个字符而另一个似乎是
是一个tablename不能只存在数字。

因此,在PHP中我尝试创建一个名为12345-name的表。它完全失败了。


发布错误消息和示例代码。


创建一个名称不好的表需要名称旁边的引号。

引用的类型取决于MySQL服务器启动的选项。

如果你需要引用标识符,它几乎总是意味着你选择了一个坏的
$ b标识符的$ b名称...

根据mysql
手册,它让我感到很困惑。
当然,表定义应该遵循它。如果我将
表名更改为仅名称 ..然后我可以在Mysql下创建表格
4.0.11a。
但我希望我的桌面名称包含faxnumber-name,没有别的。




为什么要在表名中编码数据?


-

Andy Hassall(an**@andyh.co.uk)icq( 5747695)( http://www.andyh.co.uk

空间:磁盘使用情况分析工具( http://www.andyhsoftware。 co.uk/space


Andy Hassall写道:

2003年11月10日星期一23:39 :34 + 0100,Andreas Paasch< An ***** @ Paasch.Net>
写道:

[snip]
发布错误消息和示例代码。


对不起,我决定不发布这些,因为我认为它们没有价值,因为我知道问题在于命名结构要创建的表..

只是在这里显示它,以防万一....


代码部分:



I''ve read around, especially at mysql.com to see if there are any
limitations to tablenames, one is 64 characters and the other one seems to
be that a tablename can''t exist only numeric.

So, within PHP I try to create a table with name "12345-name" and it fails
entirely.

It get''s me rather puzzled as it should be possible according to the mysql
manual.
Of course, the table definition follows as it should. If i change the
tablename to only "name" .. then I can create the table under Mysql
4.0.11a.
But I want my tablenames to consist of faxnumber-name, nothing else.

Is there anything I missed somewhere that prevents me from doing what I
want?

I''m sorta confused here ...

/Andreas

--
Registeret Linux user #292411

解决方案

Works fine for me... just tried it with phpMyAdmin... try not using quotes,
or single quotes? Then again I do believe im on MySQL 3.X... maybe thats
it?
-Eric Kincl

Andreas Paasch wrote:


I''ve read around, especially at mysql.com to see if there are any
limitations to tablenames, one is 64 characters and the other one seems to
be that a tablename can''t exist only numeric.

So, within PHP I try to create a table with name "12345-name" and it fails
entirely.

It get''s me rather puzzled as it should be possible according to the mysql
manual.
Of course, the table definition follows as it should. If i change the
tablename to only "name" .. then I can create the table under Mysql
4.0.11a.
But I want my tablenames to consist of faxnumber-name, nothing else.

Is there anything I missed somewhere that prevents me from doing what I
want?

I''m sorta confused here ...

/Andreas




On Mon, 10 Nov 2003 23:39:34 +0100, Andreas Paasch <An*****@Paasch.Net> wrote:

I''ve read around, especially at mysql.com to see if there are any
limitations to tablenames, one is 64 characters and the other one seems to
be that a tablename can''t exist only numeric.

So, within PHP I try to create a table with name "12345-name" and it fails
entirely.
Post error messages and example code.

To create a table with a bad name like that requires quotes around the name.
The type of quotes depends on with what options the MySQL server was started.
If you ever need to quote identifiers, it almost always means you chose a bad
name for the identifier...
It get''s me rather puzzled as it should be possible according to the mysql
manual.
Of course, the table definition follows as it should. If i change the
tablename to only "name" .. then I can create the table under Mysql
4.0.11a.
But I want my tablenames to consist of faxnumber-name, nothing else.



Why are you encoding data in the table name?

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)


Andy Hassall wrote:

On Mon, 10 Nov 2003 23:39:34 +0100, Andreas Paasch <An*****@Paasch.Net>
wrote:
[snip]
Post error messages and example code.
Sorry, I decided not to post those as I didn''t think they were of value as I
know the problem lies in the naming structure of the table to create ..
just showing it here anyways, just in case ....

Code part:


这篇关于创建表 - 不能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆