Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » Mysql »

Ayuda con install.php

Estas en el tema de Ayuda con install.php en el foro de Mysql en Foros del Web. Hola necesito que me ayuden con este scrip de instalacion de tablas el cual de devuelve este error: Invalid default value for 'AccountType' at row ...
  #1 (permalink)  
Antiguo 18/07/2009, 09:09
 
Fecha de Ingreso: octubre-2007
Mensajes: 39
Antigüedad: 16 años, 5 meses
Puntos: 1
Ayuda con install.php

Hola necesito que me ayuden con este scrip de instalacion de tablas el cual de devuelve este error: Invalid default value for 'AccountType' at row 49


install.php (PARTE1 DEL SCRIP)

<?
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', ' email')";
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__);
  #2 (permalink)  
Antiguo 18/07/2009, 09:11
 
Fecha de Ingreso: octubre-2007
Mensajes: 39
Antigüedad: 16 años, 5 meses
Puntos: 1
Respuesta: Ayuda con install.php

install.php (PARTE1 DEL SCRIPT)

$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', '[email protected]', '1234 My Street/r/n Red Deer, Alberta /r /nCanada', '[email protected]', '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>";


?>
  #3 (permalink)  
Antiguo 18/07/2009, 09:26
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Respuesta: Ayuda con install.php

AccountType int(1) NOT NULL default '',

Un campo de tipo entero no puede tener como valor por defecto una cadena vacía. Prueba poniendo 0 como valor por defecto.

P.S.: Por favor, no coloques código de programación en el foro de Bases de Datos.
Véase: http://www.forosdelweb.com/f21/funci...-datos-413499/
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:12.