Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL], blad serwera: MySQL server version for the right syntax to use near &#
godzio89
post
Post #1





Grupa: Zarejestrowani
Postów: 27
Pomógł: 1
Dołączył: 18.07.2008

Ostrzeżenie: (0%)
-----


Witam mam maly problem. Aktulnie ucze sie Php/Mysql z Ksiazki "Php 5, Mysql, Apache od podstaw".Mam taki kod
CODE

$connect = mysql_connect("localhost", "root", "piotrg") or
die ("Sprawdz polaczenie z serwerem.");

//utworz baze danych, jesli nie instnieje
$create = mysql_query("CREATE DATABASE IF NOT EXISTS moviesite")
or die(mysql_error());

//wybierz nowo utworzona baze danych
mysql_select_db("moviesite");

//utworz tabele "movie"
$movie = "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)
)";

$results = mysql_query($movie)
or die(mysql_error());

//utworz tabele "movietype"
$movietype = "CREATE TABLE movietype (
movietype_id int(11) NOT NULL auto_increment,
movietype_label varchar(100) NOT NULL,
PRIMARY KEY (movietype_id)
)";

$results = mysql_query($movietype)
or die(mysql_error());

//utworz tabele "people"
$people = "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_isdirector tinyint(1) NOT NULL default 0,
PRIMARY KEY (people_id)
)";

$results = mysql_query($people)
or die(mysql_error());

echo "Poprawnie utworzono baze danych filmow!";
?>


I jak wchodze na localhosta i wpisuje localhost://adres//..//itp//creatmovie.php wyskakuje mi taki blad:
CODE

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 ';
movie_leadactor int(11) NOT NULL default 0, movie_director int(11) NOT N' at line 5


I nie wiem co jest zle;/Aktualnie uzywam Serwera Xampp.

Ten post edytował godzio89 18.07.2008, 22:44:19
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 00:39