Hello again!
I took a break from this project because I was overlooking little things. Now that I've come back to it, I decided to play with the SQL databases available to me through a hosted site I bought in order to learn. I also was able to set up the tables for my project correctly (I think).
Now I am trying to understand how to populate my tables. So far, I have the following:
<?
//connect to MySQL
$con = mysql_connect('HOST','USER','PASSWORD') or
die ("ERROR");
//Select Database
mysql_select_db('movie', $con)
//Insert data into "movie" table
$insert="INSERT INTO movie (movie_id, movie_name, movie_type, movie_year,
movie_leadactor, movie_director)
VALUES (1, 'Bruce Almighty', 5, 2003, 1, 2),
(2, 'Office Space', 5, 1999, 5, 6),
(3, 'Grand Canyon', 2, 1991, 4, 3)";
$result=mysql_query($insert)
or die(mysql_error());
//insert data into "movietype" table
$type="INSERT INTO movietype (movietype_id, movietype_label)
VALUES (1, 'SciFi'),
(2, 'Drama'),
(3, 'Adventure'),
(4, 'War'),
(5, 'Comedy'),
(6, 'Horror'),
(7, 'Action'),
(8, 'Kids')";
$result=mysql_query($type)
or die(mysql_error());
//insert data into "people" table
$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 Livingston', 1, 0),
(6, 'Mike Judge', 0, 1)";
$result=mysql_query($people)
or die(mysql_error());
echo "Data inserted successfully!"
?>
However, upon running this code in my browser I get the following error:
Parse error: parse error, unexpected T_STRING in /home/content/a/d/v/USER/html/moviedata.php on line 31
which is this line, if I am counting correctly:
$people="INSERT INTO people (...
Please help me understand what I'm doing wrong!