
<?php $insert = "INSERT INTO movie(movie_id, movie_name, movie_type, " . "movie_year, movie_leadactor, movie_director) " . "VALUES (1. 'Bruce Wszechmogacy', 5, 2003, 1, 2), " . "(2. 'Zycie biurowe', 5, 1999, 5, 6), " . "(3. 'Wielki Kanion', 2, 1991, 4, 3)". $type = "INSERT INTO movietype (movietype_id, movietype_label)" . "VALUES (1. 'Science-fiction'), " . "(2. 'Dramat'), " . "(3. 'Przygoda'), " . "(4. 'Wojenny'), " . "(5. 'Komedia'), " . "(6. 'Horror'), " . "(7. 'Akcja'), " . "(8. 'Dla Dzieci'), " . $people = "INSERT INTO people (people_id, people_fullname, ". "people_isactor, people_isdirector) " . "VALUES (1. Jim Carrey, 1, 0), " . "(2. 'Tom Shadyac', 0, 1), " . "(3. 'Lwrence Kasdan', 0, 1), " . "(4. 'Kevin Kline', 1, 0), " . "(5. 'Ron Livingstone', 1, 0), " . "(6. 'Mike Judge', 0, 1), " . ?>
Tutaj wyszło, że dane wpisane są poprawnie na końcu, ale gdy tworze tabele używam kodu:
<?php $query = "SELECT * " . "FROM movie " . "WHERE movie_year>1990 " . "ORDER BY movie_type"; foreach($row as $value) { } } ?>