Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 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 March 28th, 2005, 01:03 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mAhmed
Default php won't inseret in MYSQL chapter 3

Hi everyone, I have been trying to get this script to upload info to a mysql database but i get this error:
Code:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\FoxServ\www\admin\_debug_tmp.php on line 7
the code is as follows:
Code:
<?php
$connect = mysql_connect("localhost", "root", "dbpassword") or die("Database connection error");
mysql_select_db("magazine");
$query = "INSERT INTO authors
(firstName,lastName,username,password,email)
VALUES
($_POST['firstName'],$_POST['lastName'],$_POST['username'],$_POST['password'],$_POST['email'])";
$result = mysql_query($query) or die(mysql_error());
echo "Account created successfully<br>";
?>
I can't see any errors, I'm attempting to follow the example in the book (page 100) to insert data into the movie_type database, but have no clue to what the mistake might be, any clues.

Thanks in advance.






Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 10 Emailing with php - firstmail.php vijdev BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 July 19th, 2007 01:12 AM
PHP and MySQL MiNdWaRp PHP How-To 0 May 14th, 2007 06:25 PM
MySQL/PHP Help blackout Beginning PHP 1 August 8th, 2006 07:49 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Chapter 9 - Apache, PHP and Mysql Development AMP_Engineer Beginning PHP 1 September 25th, 2004 11:27 AM





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