Muchas gracias eso me soluciono el proble pero ahora me sale este problema,
Query was empty
mire el codigo:
<?php
// conectarce al MySQL;
//su no,bre de host, nombre de usuario y contraseña
$connect =mysql_connect("localhost", "root", "") or
die ("No se pudo conectar al servidor intentelos mas tarde");
// compruebe que la nueva base de datos es la activa
mysql_create_db("wiley")
// cree la tabla "movie"
$insert= "INSERT INTO movie( movie_id, movie_name, movie_type, movie_year, movie_leadactor, movie_director)
VALUES (1, 'batman', 5, 2003, 1, 2),
(2, 'spaiderman', 5, 1999, 5, 6),
(3, 'x-man', 2, 1993, 4, 3)";
$results= mysql_query($insert)
or die (mysql_error());
// cree ala tabla movietype
$type = "INSERT INTO movietype( movietype_id , movietype_label)
VALUES(1,'Sc1'),
(2,'drama')
(3,'adventura'),
(4,'guerra'),
(5,'comedia'),
(5,'horror'),
(7,'accion'),
(8,'romance')";
$results= mysql_query($type)
or die (mysql_error());
// crea la tabal people
$people = "INSERT INTO people(people_id, people_fullname, people_isactor, people_isdirector)
VALUES (2,'tam sanday',0, 1),
(2,'tam sanday',0, 1),
(2,'tam sanday',0, 1),
(2,'tam sanday',0, 1),
(2,'tam sanday',0, 1),
(2,'tam sanday',0, 1)";
$results= mysql_query($people)
or die (mysql_error());
echo "base de datos creada";
?>
ese codigo no era el codigo es este:
<?php
// coneccion a la base datos;
$connect =mysql_connect("localhost", "root", "") or
die ("No se pudo conectar al servidor intentelos mas tarde");
// crea la base de datos principal
/*mysql_create_db("wiley")
or die(mysql_error());*/
//mysql_query("CREATE DATABASE wiley") or die(mysql_error());
//comprueva la base de dato se activo..
mysql_select_db("wiley");
// crea la tabla ''movie"'
$movie = mysql_query("CREATE TABLE movie (
movie_id int(11) NOT NULL auto_increment,
movie_name varchar (255) NOT NULL,
movie_type tinyint (2) NOT NULL default 0,
movie_year int(4) NOT NULL default 0,
movie_leadactor int(11) NOT NULL default 0,
movie_director int(11) NOT NULL default 0,
PRIMARY KEY (movie_id),
KEY movie_type (movie_type, movie_year),
) TYPE=MyISAM AUTO_INCREMENT=4");
$results =mysql_query($movie)
or die (mysql_error());
//crea la tabla de "movietype"
$movietype = mysql_query("CREATE TABLE movietype (
movietype_id int(11) NOT NULL auto increment,
movietype_label varchar(100) NOT NULL,
PRIMARY KEY (movietype_id),
)TYPE=MyISAM AUTO_INCREMENT=9");
$results =mysql_query($movietype)
or die (mysql_error());
// crea la tabla "people"
$people = mysql_query("CREATE TABLE people (
people_id int(11) NOT NULL auto increment,
people_fullname varchar(255) NOT NULL,
people_isactor tinyint(1) NOT NULL default 0,
people_isdirectot tinyint(1) NOT NULL default 0,
PRIMARY KEY (people_id),
)TYPE=MyISAM AUTO_INCREMENT=7");
$results =mysql_query($people)
or die (mysql_error());
echo "la base de datos de película satisfactoriamente crea!";
?>
Última edición por GatorV; 20/12/2008 a las 19:43 |