第49行'{AccountType'的默认值无效

时间:2017-10-13 16:55:42

标签: php sql

我有这个php网站,我安装回2009年没有错误。现在,当我尝试安装它并运行install.php时,我收到错误“第49行'AccountType'的默认值无效”

请帮助......有完整的脚本:

<?
require_once("conn.php");

$q1 = "DROP TABLE IF EXISTS re2_admin";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_admin (
  AdminID varchar(50) NOT NULL default '',
  AdminPass varchar(32) NOT NULL default '',
  AdminName varchar(100) NOT NULL default '',
  AdminEmail varchar(150) NOT NULL default '',
  PRIMARY KEY (AdminID))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_admin VALUES ('admin', 'admin', 'Deb', 'neo@cyberia.ca')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_agents";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_agents (
  AgentID int(10) NOT NULL auto_increment,
  AccountType int(1) not null default '',
  username varchar(50) NOT NULL default '',
  password varchar(32) NOT NULL default '',
  FirstName varchar(150) NOT NULL default '',
  LastName varchar(150) NOT NULL default '',
  resume text NOT NULL,
  phone varchar(50) NOT NULL default '',
  cellular varchar(50) NOT NULL default '',
  pager varchar(50) NOT NULL default '',
  ResumeImages text NOT NULL,
  email varchar(150) NOT NULL default '',
  logo varchar(255) NOT NULL default '',
  RegDate int(10) NOT NULL default '0',
  ExpDate int(10) NOT NULL default '0',
  AccountStatus varchar(20) NOT NULL default 'pending',
  PriorityLevel int(1) NOT NULL default '2',
  offers int(3) NOT NULL default '0',
  news char(1) NOT NULL default 'y',
  NewsletterType varchar(10) NOT NULL default 'plain',
  days10 char(1) NOT NULL default 'n',
  days5 char(1) NOT NULL default 'n',
  days1 char(1) NOT NULL default 'n',
  PRIMARY KEY (AgentID),
  UNIQUE KEY username(username),
  UNIQUE KEY email(email))";

mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_banners";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_banners (
  ClientID int(10) NOT NULL default '0',
  BannerID int(10) NOT NULL auto_increment,
  BannerURL varchar(255) NOT NULL default '',
  BannerFile varchar(255) NOT NULL default '',
  BannerAlt varchar(255) NOT NULL default '',
  BannerType varchar(50) NOT NULL default '',
  bCat int(10) NOT NULL default '0',
  bSub int(10) NOT NULL default '0',
  PRIMARY KEY (BannerID))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_categories";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_categories (
  CategoryID int(10) NOT NULL auto_increment,
  CategoryName varchar(255) NOT NULL default '',
  PRIMARY KEY (CategoryID),
  UNIQUE KEY CategoryName(CategoryName))";

mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_categories VALUES (3, 'For Sale')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_categories VALUES (4, 'For Rent')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_listings";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_listings (
  ListingID int(10) NOT NULL auto_increment,
  AgentID int(10) NOT NULL default '0',
  CategoryID int(10) NOT NULL default '0',
  SubcategoryID int(10) NOT NULL default '0',
  address text NOT NULL,
  city varchar(100) NOT NULL default '',
  state varchar(100) NOT NULL default '',
  country varchar(150) NOT NULL default '',
  ShortDesc text NOT NULL,
  DetailedDesc text NOT NULL,
  Price float(15,2) NOT NULL default '0.00',
  PropertyType varchar(50) NOT NULL default '',
  neighbourhood text NOT NULL,
  rooms int(2) NOT NULL default '0',
  bathrooms int(2) NOT NULL default '0',
  fireplace char(1) NOT NULL default 'n',
  garage int(2) NOT NULL default '0',
  SquareMeters float(15,2) NOT NULL default '0.00',
  LotSize float(15,2) NOT NULL default '0.00',
  HomeAge int(3) NOT NULL default '0',
  NearSchool char(1) NOT NULL default 'n',
  NearTransit char(1) NOT NULL default 'n',
  NearPark char(1) NOT NULL default 'n',
  OceanView char(1) NOT NULL default 'n',
  LakeView char(1) NOT NULL default 'n',
  MountainView char(1) NOT NULL default 'n',
  OceanWaterfront char(1) NOT NULL default 'n',
  LakeWaterfront char(1) NOT NULL default 'n',
  RiverWaterfront char(1) NOT NULL default 'n',
  image text NOT NULL,
  DateAdded int(10) NOT NULL default '0',
  visits int(10) NOT NULL default '0',
  PRIMARY KEY (ListingID)) ";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_mail_archive";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_mail_archive (
  subject varchar(255) NOT NULL default '',
  message text,
  MailDate int(10) NOT NULL default '0')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_prices";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_prices (
  PackageName varchar(50) NOT NULL default '',
  PriceID int(10) NOT NULL auto_increment,
  PriceValue float(5,2) NOT NULL default '0.00',
  Duration varchar(10) NOT NULL default '',
  PriorityLevel int(1) NOT NULL default '0',
  PriceType varchar(10) NOT NULL default '0',
  offers int(10) NOT NULL default '0',
  PRIMARY KEY (PriceID))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_prices VALUES ('Realtor Bronze', 7, '14.95', '1', 1, 'Realtor', 5)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_prices VALUES ('Private Listing', 9, '9.95', '1', 1, 'Private', 1)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_prices VALUES ('Realtor Silver', 10, '24.95', '1', 1, 'Realtor', 10)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_prices VALUES ('Realtor Gold', 11, '39.95', '1', 1, 'Realtor', 20)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);



$q1 = "DROP TABLE IF EXISTS re2_priority";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_priority (
  PriorityID int(10) NOT NULL auto_increment,
  PriorityName varchar(50) NOT NULL default '',
  PriorityLevel int(1) NOT NULL default '0',
  PRIMARY KEY (PriorityID),
  UNIQUE KEY PriorityName(PriorityName))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_priority VALUES (1, 'Standard', 1)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);




$q1 = "DROP TABLE IF EXISTS re2_settings";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_settings (
  id int(1) NOT NULL default '0',
  SiteTitle varchar(255) NOT NULL default '',
  SiteName varchar(255) NOT NULL default '',
  SiteKeywords varchar(255) NOT NULL default '',
  SiteDescription text,
  ContactEmail varchar(150) NOT NULL default '',
  CompanyAddress text,
  PayPalEmail varchar(150) NOT NULL default '',
  SellerID int(6) NOT NULL default '0',
  Agreement text NOT NULL,
  sp_vendor_email varchar(255) NOT NULL default '',
  sp_payee_email varchar(255) NOT NULL default '',
  sp_secret_code varchar(255) NOT NULL default '')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_settings VALUES ('1', 'My Real Estate', 'My Real Estate', 'real estate, sales, rent, for rent, for sale, house, houses, appartment, appartments, studio, studios, rooms', 'Find property for sale and rent', 'neo@cyberia.ca', '1234 My Street/r/n Red Deer, Alberta /r /nCanada', 'neo@cyberia.ca', '12345', '<strong>User Agreement</strong><br> <p><br>The information presented by this siteis deemed to be accurate, but it has not been independently verified. We make no guarantee, warranty or representation. It is the user\'s responsibility to independently confirm accuracy and completeness. </p><p>User Conduct<br>User agrees to abide by all applicable local, state, national and foreign laws, treatises and regulations in connection with the service. The user agrees to not transmit or post information that is harmful to other members.</p<p>Termination<br>This website in its sole discretion, may terminate user\'s password, account or use of the service and remove and discard any data within the service if user fails to comply with this Agreement. User may terminate the service upon notice to this website at any time; however, user will not receive a refund of any portion of fees paid. Upon termination, user\'s rights to use the service, web solutions, domain name, design and associate technologies will also terminate. </p><p>Indemnification<br>User shall indemnify and hold e1solutions and its parents, subsidiaries, affiliates, officers, directors, employees, attorneys, and agents, harmless from and against any and all claims, costs, damages, losses, liabilities, and expenses (including attorneys\' fees and costs) arising out of, or in connection with user\'s use of the service (including the content) or breach of this Agreement. </p><p>Limitation of Liability<br>In no event shall this website aggregate liability exceed the amount actually paid by user in the twelve (12) month period immediately preceding the event giving rise to such a claim. In no event shall e1 Solutions be liable to anyone for any indirect, punitive, special, exemplary, incidental, consequential or other damages of any type or kind arising out of, or in any way connected with this service, including but not limited to user\'s use or inability to use the service or for any content obtained from or through the service, even if e1 solutions has been previously advised of the possibility of such damages. </p><p><br></p>', '', '', '')";

mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_stats";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_stats (
  BannerID int(10) NOT NULL default '0',
  impressions int(10) NOT NULL default '0',
  clicks int(10) NOT NULL default '0',
  mydate int(10) NOT NULL default '0',
  ip varchar(50) NOT NULL default '')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "DROP TABLE IF EXISTS re2_subcategories";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_subcategories (
  SubcategoryID int(10) NOT NULL auto_increment,
  SubcategoryName varchar(255) NOT NULL default '',
  CategoryID int(10) NOT NULL default '0',
  PRIMARY KEY (SubcategoryID))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (3, 'Apartments/Suites', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (4, 'Duplexes/Houses', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (5, 'Farms/Lots and Acreages', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (6, 'Garages & Parking Space', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (7, 'Mobile Homes', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (8, 'Out of Town', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (9, 'Room and Board/Rooms', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (10, 'Shared Accomodation', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (11, 'Storage Space', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (12, 'Townhouses/Condos', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (13, 'Vacation Rentals', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (14, 'Wanted to Rent', 4)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (15, 'Commercial/Industrial', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (16, 'Duplexes/Houses', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (17, 'Farms/Ranches', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (18, 'Income Properties', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (19, 'Lots/Acreages', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (20, 'Mobile Homes', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (21, 'New Homes', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (22, 'Opem Houses', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (23, 'Real Estate Services', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (24, 'Vacation Property', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_subcategories VALUES (25, 'Wanted', 3)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);




$q1 = "DROP TABLE IF EXISTS re2_types";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE re2_types (
  TypeID int(10) NOT NULL auto_increment,
  TypeName varchar(100) NOT NULL default '',
  PRIMARY KEY (TypeID),
  UNIQUE KEY TypeName(TypeName))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);


$q1 = "INSERT INTO re2_types VALUES (20, 'Farm')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (19, 'Acreage')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (18, 'Ranch')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (17, 'Townhouse')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (16, 'Rooms')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (15, 'Mobile Home')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (14, 'Lot')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (13, 'Land')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (12, 'Industrial')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (11, 'Houses')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (10, 'Condo')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (8, 'Commercial')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO re2_types VALUES (9, 'Appartments')";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

echo "<center><br><br><br><font face=tahoma, verdana, helvetica, arial size=2 color=black><b>The database tables was installed successfully!<br><br>Delete this file from your server!</b></font></center>";


?>

1 个答案:

答案 0 :(得分:0)

您需要更改此行:

AccountType int(1) not null default '',

这样的事情:

AccountType int(1) not null default 11,

我不确定您希望默认的AccountType值是什么,因此假设11是您需要的值。我用了11,因为我假设你的re2_types表是引用的值,11代表“房子”,如下所示:

$q1 = "INSERT INTO re2_types VALUES (11, 'Houses')";