Wrox Programmer Forums
|
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2011, 07:54 AM
Registered User
 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 movie.php

A duplicated data in the select input,
<?php
// select the movie type information
$query = 'SELECT
movietype_id, movietype_label
FROM
movietype
ORDER BY
movietype_label';
$result = mysql_query($query, $db) or die(mysql_error($db));

// populate the select options with the results
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $value) {
if ($row['movietype_id'] == $movie_type) {
echo '<option value="' . $row['movietype_id'] .
'" selected="selected">';
} else {
echo '<option value="' . $row['movietype_id'] . '">';
}
echo $row['movietype_label'] . '</option>';
}
}
?>
any help thanks
 
Old July 13th, 2011, 08:48 AM
Registered User
 
Join Date: Jul 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just remove the foreach statements.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed.Chap.6 in movie.php Binayak BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 November 14th, 2010 06:00 AM
Expanding on chapter 6 and the movie site in gen newbreed65 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 September 27th, 2008 11:56 AM
ch 6 commit.php problem updating movie table statusquo BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 May 2nd, 2005 10:02 PM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM
Chapter 12 - movie example PatrickJ BOOK: Beginning ASP 3.0 8 June 7th, 2004 01:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.