2012-10-09 45 views
-3
  • 服务器:localhost通过UNIX套接字
  • Server版本:5.5.23-55
  • 协议版本:10
  • MySQL的字符集:UTF-8的Unicode(UTF-8 )
  • cpsrvd 11.32.4.13
  • MySQL客户端版本:5.5.23

嗨,我 保持getti ng MySql错误。以下是错误:我不断收到一个错误在MySQL语法

Error 

SQL query: 

# LedAds 2.x SQL Def file 
# http://www.ledscripts.com/ 
# Do NOT try to dump this straight in 
# If you must do dump this in yourself, then replace all of the 
# {prefix} with whatever prefix you decided on when configuring everything 
# Host: localhost 
# Generation Time: Feb 11, 2002 at 08:32 PM 
# Server version: 3.23.42 
# Database : `pla` 
# -------------------------------------------------------- 
# 
# Table structure for table `pla_ads` 
# 
CREATETABLE {prefix}_ads(

aid int(10)unsigned NOTNULLAUTO_INCREMENT , 
TYPE enum('image','rich')NOTNULL default'image', 
did int(10)unsigned NOTNULL default'0', 
active enum('yes','no')NOTNULL default'yes', 
datetime datetime NOTNULL default'0000-00-00 00:00:00', 
PRIMARYKEY (aid) 
) TYPE=MYISAM ; 



MySQL said: 
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{prefix}_ads (
    aid int(10) unsigned NOT NULL auto_increment, 
    type enum('im' at line 18 

这里是我的代码:

# 

CREATE TABLE {prefix}_ads (
    aid int(10) unsigned NOT NULL auto_increment, 
    type enum('image','rich') NOT NULL default 'image', 
    did int(10) unsigned NOT NULL default '0', 
    active enum('yes','no') NOT NULL default 'yes', 
    datetime datetime NOT NULL default '0000-00-00 00:00:00', 
    PRIMARY KEY (aid) 
) TYPE=MyISAM; 
# -------------------------------------------------------- 

# 
# Table structure for table `pla_images` 
# 

CREATE TABLE {prefix}_images (
    did int(10) unsigned NOT NULL auto_increment, 
    image_url varchar(255) NOT NULL default '', 
    url varchar(255) NOT NULL default '', 
    alt_text varchar(150) NOT NULL default '', 
    target varchar(20) NOT NULL default '', 
    width int(11) NOT NULL default '0', 
    height int(11) NOT NULL default '0', 
    PRIMARY KEY (did) 
) TYPE=MyISAM; 
# -------------------------------------------------------- 

# 
# Table structure for table `pla_impressions` 
# 

CREATE TABLE {prefix}_impressions (
    aid int(10) unsigned NOT NULL default '0', 
    impdate date NOT NULL default '0000-00-00', 
    displays bigint(20) unsigned NOT NULL default '0', 
    clicks int(11) NOT NULL default '0', 
    PRIMARY KEY (aid,impdate) 
) TYPE=MyISAM; 
# -------------------------------------------------------- 

# 
# Table structure for table `pla_richtext` 
# 

CREATE TABLE {prefix}_richtext (
    did int(10) unsigned NOT NULL auto_increment, 
    data mediumtext NOT NULL, 
    PRIMARY KEY (did) 
) TYPE=MyISAM; 

我的确改变了TYPE发动机,但仍然看到错误...

请帮帮忙!

+0

您是否试图按照原样执行这些查询,是否将{前缀}替换为实际前缀?我假设你可能在某个阶段想用实际的前缀替换它。 –

+0

答案位于脚本顶部的评论部分。 –

+0

#如果你必须自己做这个转储,那么把所有的 #{前缀}替换成你在配置时决定的任何前缀 – Jocelyn

回答

1

该SQL脚本应该由PHP脚本,改变{prefix}一个有效的前缀名

总之要拼命地跑:{prefix}是无效的,它应该是你的前缀没有{}

+0

谢谢!现在我又遇到了另外一个问题:致命错误:在不在/ home/mu/public_html/ledads/common.inc.php(168)中的对象上下文中使用$ this:第2行的运行时创建函数 – user1695573

+0

这是另一回事。另一个问题,另一个问题。考虑接受其中一个答案,如果他们解决了这个问题并提出另一个问题 –

+0

我希望我知道如何接受。怎么样? – user1695573

0

您{前缀}没有定义,因此MySQL不知道它的值是什么 - >会产生错误。

出于测试目的,将“{prefix}”的所有条目替换为“my_prefix”,您应该很好。

+0

现在它正在加工..这将有助于如果我读.. :( – user1695573

1

# Do NOT try to dump this straight in

# If you must do dump this in yourself, then replace all of the

# {prefix} with whatever prefix you decided on when configuring everything

+0

感谢它的工作..现在我有另一个问题: – user1695573

相关问题