Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 28th, 2005, 01:03 PM
Registered User
 
Join Date: Mar 2005
Location: Gatineau, Quebec, Canada.
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

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



All times are GMT -4. The time now is 09:19 AM.


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