chapter 4 error on runtime
<?php
$db=mysql_connect("localhost","root","") or die("Unable to connect!Pls check your connection parameters.");
mysql_select_db(moviesite,$db) or die(mysql_error($db));
//alter the movie table to include time,cost and takings
$query='ALTER TABLE movie ADD COLUMN(
movie_running_time TINYINT UNSIGNED NULL,
movie_cost DECIMAL(4,1) NULL,
movie_takings DECIMAL(4,1) NULL)';
mysql_query($query,$db) or die(mysql_error($db));
//insert new data into the movie table for each movie
$query="UPDATE movie SET movie_running_time=111,movie_cost=81,movie_takings =242.6 WHERE movie_id=1";
mysql_query($query,$db) or die(mysql_error($db));
$query="UPDATE movie SET movie_running_time=87,movie_cost=10,movie_takings= 10.8 WHERE movie_id=2";
mysql_query($query,$db) or die(mysql_error($db));
$query="UPDATE movie SET movie_running_time=164,movie_cost=NULL,movie_takin gs=33.2 WHERE movie_id=3";
mysql_query($query,$db) or die(mysql_error($db));
echo "Movie database successfully updated";
?>
its giving error
Duplicate column name 'movie_running_time'
|