 |
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
|
|
|
|

October 6th, 2010, 06:05 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
|
|
PHP Code:
FROM
comic_character c, comic_lair l, comic_zipcode AS z
There is only one AS at line 9!! Try without that!
|
|

October 6th, 2010, 06:16 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 20
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Ok, I got rid of the AS and tried to run this code:
Code:
<?php
require 'includes/db.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or die ('Unable to connect');
mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
$character_id = 2;
$query = 'SELECT
c.alias, c.real_name, c.alignment,
l.address, z.city, z.state, z.zipcode_id
FROM
comic_character c, comic_lair l, comic_zipcode z
WHERE
z.zipcode_id = l.zipcode_id AND
c.lair_id = l.lair_id AND
c.character_id = '. $character_id;
$result = mysql_query($query, $db) or die(mysql_error($db));
if (mysql_num_rows($result) > 0) {
$action = 'Edit';
$character = mysql_fetch_assoc($result);
echo $character['alias'];
}
?>
I dont' get the MySQL error message anymore, but I get a totally blank white screen.
|
|

October 6th, 2010, 08:59 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 20
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Oh never mind, I finally figured it out! The MySQL code is correct. I left out a line in the char_transactions.php file that inserted info into the comic_zipcode table. That was screwing up the query. It works fine now. Thank for your kind efforts of helping!
|
|

October 7th, 2010, 03:33 AM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Good! Well done, bye! 
|
|
 |