Hi,
I can’t seem to get the code working.
It does not add the table etc to the MYSQL database.
Please can someone assist me and see what I am doing wrong:
[php]
Untitled Document <?php //connect to mysql $connect = mysql_connect('localhost', 'ash', 'Otorbet52@') or die ("Hello Looser, You dont have access");//make sure databse is correct
mysql_select_db(“moviesite”);
//insert data into movie database
$insert = "INSERT INTO movie (movie_id, movie_name, movie_type, " .
“movie_year, movie_leadactor, movie_director)” .
"VALUES (1, ‘Bruce Almighty’, 5, 2001, 1, 2), " .
"(2, ‘Office’, 4, 2004, 1, 2), " .
“(3, ‘Need for Speed’, 2, 2005, 2, 1)”;
$results = mysql_query($insert)
or die(mysql_error());
$type = "INSERT INTO movietype (movietype_id, movietype_label) " .
"VALUES (1, ‘Sci-Fi’), " .
"(2, ‘Drama’), " .
"(3, ‘Action’), " .
"(4, ‘Comedy’), " .
"(5, ‘Horror’), " .
“(6, ‘War’)”;
$results = mysql_query($type)
or die(mysql_error());
$people = "INSERT INTO people (people_id, people_fullname, " .
“people_isactor, people_isdirector)” .
"VALUES (1, ‘Jim Carrey’), " .
"(2, ‘Ron Livingston’), " .
"(3, ‘Tom Shady’), " .
"(4, ‘Mary Jane’), " .
"(5, ‘Jimmy Raw’), " .
“(6, ‘Cat Stevens’)”;
$results = mysql_query($people)
or die (mysql_error());
echo “Data inserted successfully”
?>