-3
  • Server: Localhost via UNIX socket
  • Server version: 5.5.23-55
  • Protocol version: 10
  • MySQL charset: UTF-8 Unicode (utf8)
  • cpsrvd 11.32.4.13
  • MySQL client version: 5.5.23

Hi, I keep getting MySql errors. Here is the error:

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 

Here is my code:

#

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;

I did change TYPE to ENGINE but still saw errors...

Please help!

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
  • Are you trying to execute these queries as it is, means is {prefix} is ever replaced with actual prefix ? I assume that you might at some stage want to replace it with actual prefix. – Murtuza Kabul Oct 09 '12 at 14:54
  • The answer is in the comment section at the top of the script. – Raffael Luthiger Oct 09 '12 at 14:56
  • # If you must do dump this in yourself, then replace all of the # {prefix} with whatever prefix you decided on when configuring everything – Jocelyn Oct 09 '12 at 16:49
  • This might be helpful: http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/12771239#12771239 – hakre Oct 09 '12 at 18:22

3 Answers3

1

This SQL script should be runned by a PHP script that changes the {prefix} to a valid prefix name

In short: {prefix} is not valid, it should be your prefix without the {}

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
  • thanks! now i got another issues: Fatal error: Using $this when not in object context in /home/mu/public_html/ledads/common.inc.php(168) : runtime-created function on line 2 – user1695573 Oct 09 '12 at 15:19
  • that's another thing. another issue, another question. Consider accepting one of the answer if they solved this problem and ask another question – Mihai Iorga Oct 10 '12 at 06:53
  • i wish i knew how to accept. how? – user1695573 Oct 11 '12 at 18:56
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

Community
  • 1
  • 1
Lee
  • 10,496
  • 4
  • 37
  • 45
0

Your {prefix} isn't defined, hence MySQL doesn't know what the value of that is -> creates error.

For testing purposes, replace all entries of "{prefix}" with "my_prefix" and you should be good to go.

Coreus
  • 5,360
  • 3
  • 35
  • 50