Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 25th, 2012, 01:02 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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'
Reply With Quote
  #2 (permalink)  
Old April 30th, 2013, 06:15 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs up

Duplicate column name 'movie_running_time'
This error is occur because of their is some value or id of that column may be same.
check out the database and may be some value will be duplicate.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error from Chapter 11 Code winkle BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 April 22nd, 2009 03:41 PM
Chapter 20, p.987 Runtime Error Spasticus BOOK: Ivor Horton's Beginning Visual C++ 2005 0 January 17th, 2008 04:05 AM



All times are GMT -4. The time now is 03:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.