... the onset of PHP6, you need to take a few extra steps to convince PHP and MySQL to play well
with each other. Before your MySQL functions will be recognizable, make sure to enable MySQL in your ... EXISTS moviesite’;
mysql_ query($query, $db) or die (mysql_ error($db));
//make sure our recently created database is the active one
mysql_ select_db(‘moviesite’, $db) or die (mysql_ e...
...
< ?php
$db = mysql_ connect(‘localhost’, ‘bp6am’, ‘bp6ampass’) or
die (‘Unable to connect. Check your connection parameters.’);
mysql_ select_db(‘moviesite’, $db) or die (mysql_ error($db));
... ORDER BY
movie_type’;
$result = mysql_ query($query, $db) or die (mysql_ error($db));
// show the results
echo ‘ < table border=”1” > ’;
while ($row = mysql_ fetch_assoc($result))...
... Cataloging-in-Publication Data.
Beginning PHP6, Apache, MySQL web development / Timothy Boronczyk . . . [et al.].
p. cm.
Includes index.
ISBN 978-0-470-39114-3 (paper/website)
1. Web sites—Design. 2. ... xiiiffirs.indd xiii 12/12/08 10:48:23 AM12/12/08 10:48:23 AM
Beginning
PHP6, Apache, MySQL
®
Web Development
Introduction xxiii
Part I: Movie Review Web Site
Chap...
... AM12/12/08 10:49:43 AM
Beginning
PHP6, Apache, MySQL
®
Web Development
ffirs.indd xiiiffirs.indd xiii 12/12/08 10:48:23 AM12/12/08 10:48:23 AM
Beginning
PHP6, Apache, MySQL
®
Web Development
Enhance ... Cataloging-in-Publication Data.
Beginning PHP6, Apache, MySQL web development / Timothy Boronczyk . . . [et al.].
p. cm.
Includes index.
ISBN 978-0-470-39114...
... AMP refers to Apache, MySQL, and PHP, all of which work together to
help you develop dynamic web sites.
Now you ’ ve installed, configured and tested the installation for Apache, MySQL, and PHP, ... without breaking a live web site.
Installing Apache, My SQL , and PHP
on Windows
After following these instructions, you will have successfully installed Apache, MySQL, and...
... between Pages
Suppose your web site allows viewers to enter their name on the front page. You ’ d like to be able to
greet the user by name on each page in your web site, but to do so you need ... great Venus flytraps, just lying in wait to gobble up useful information
from web site visitors. Forms allow your web site to be truly interactive; they take data from the user and
send...
...
//connect to MySQL
$db = mysql_ connect(‘localhost’, ‘bp6am’, ‘bp6ampass’) or
die (‘Unable to connect. Check your connection parameters.’);
mysql_ select_db(‘moviesite’, $db) or die (mysql_ error($db));
... movietype_label
FROM
movietype
WHERE
movietype_id = ‘ . $type_id;
$result = mysql_ query($query, $db) or die (mysql_ error($db));
$row = mysql_ fetch_assoc($result);
ext...
... $_GET[‘id’];
$result = mysql_ query($query, $db) or die (mysql_ error($db));
$query = ‘DELETE FROM people
WHERE
people_id = ‘ . $_GET[‘id’];
$result = mysql_ query($query, $db) or die (mysql_ error($db));
... $_GET[‘id’];
$result = mysql_ query($query, $db) or die (mysql_ error($db));
$query = ‘DELETE FROM people
WHERE
people_id = ‘ . $_GET[‘id’];
$result = mysql_ query($que...
... ‘”)’;
$result = mysql_ query($query, $db) or die (mysql_ error($db));
//retrieve the image_id that MySQL generated automatically when we inserted
//the new record
$last_id = mysql_ insert_id();
... .‘”)’;
$result = mysql_ query($query, $db) or die (mysql_ error($db));
//retrieve the image_id that MySQL generated automatically when we
inserted
//the new record
$last_id =...