<?php
//połączenie z serwerem MySQL
or
die ("Sprawdź połączenie z serwerem.");
//uaktywnij odpowiednią bazę
//wstaw dane do tabeli "movie"
$insert = "INSERT INTO movie (movie_id, movie_name, movie_type, " ,
"movie_year, movie_leadactor, movie_director) " ,
"VALUES (1, 'Bruce Wszechmogący', 5, 2003, 1, 2), " ,
"(2, 'Życie biurowe', 5. 1999, 5, 6), " ,
"(3, 'Wielki Kanion', 2, 1991, 4, 3)";
//wstaw dane do tabeli "movietype"
$type = "INSERT INTO movietype (movietype_id, movietype_label) ",
"VALUES (1, 'Sciene-fiction'). " ,
"(2, 'Dramat'), " ,
"(3, 'Przygoda'), " ,
"(4, 'Wojenny') , " ,
"(5, 'Komedia') ," ,
"(6, 'Horror') , " ,
"(7, 'Akcja'), " ,
"(8, 'Dla dzieci')";
//wstaw dane do tabeli "people"
$people = "INSERT INTO people (people_id, people_fullname, " ,
"people_isactor, people_isdirector) ",
"VALUES (1, 'Jim Carey', 1, 0), ",
"(2, 'Tom Shadyac', 0, 1), " ,
"(3, 'Lawrence Kasdan', 0, 1), ",
"(4, Kevin Kline', 1, 0), " ,
"(5, 'Ron ivingston', 1, 0), " ,
"(6, 'Mike Judge', 0, 1)";
echo "Dane zostały dodane poprawnie!";
wywala błąd
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 '), (2, 'Dramat') , (3, 'Przygoda') , (4, 'Wojenny') , (5, 'Komedia') ,(6, 'Horro' at line 1nigdzie nie widzę literówki
Ten post edytował Ociu 9.11.2010, 19:31:06