Christian web host - mysql_select_db( moviesite ) or die (mysql_error()); //alter movie table to

mysql_select_db( moviesite ) or die (mysql_error()); //alter movie table to include running time/cost/takings fields $add = ALTER TABLE movie ADD COLUMN ( . movie_running_time int NULL, . movie_cost int NULL, . movie_takings int NULL) ; $results = mysql_query($add) or die(mysql_error()); //insert new data into movie table for each movie $update = UPDATE movie SET . movie_running_time=102, . movie_cost=10, . movie_takings=15 . WHERE movie_id = 1 ; $results = mysql_query($update) or die(mysql_error()); $update = UPDATE movie SET . movie_running_time=90, . movie_cost=3, . movie_takings=90 . WHERE movie_id = 2 ; $results = mysql_query($update) or die(mysql_error()); $update = UPDATE movie SET . movie_running_time=134, . movie_cost=15, . movie_takings=10 . WHERE movie_id = 3 ; $results = mysql_query($update) or die(mysql_error()); ?> 2. Save this file as alter_movie.php, then open this file in your browser. Don t worry you will see a blank screen, but your table has been altered and the information has been entered automatically. How It Works First, the script used the ALTER TABLE command to add the appropriate fields into the existing movie table, and then it used the UPDATE command to insert the new data into those fields. If you aren t familiar with these commands, you might try rereading Chapter 3. Now that you have the data in place, you need to create a new page that you ll use to display the extra movie information (movie_details.php). 123 Using Tables to Display Data
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision shared web hosting services