PDA

View Full Version : Help for a Newbie


webpenner
01-27-2001, 11:11 PM
I'm in the process of learning PHP and mySQL. I've created a db in mysql and am now attempting to input data using an html page and a php page but I'm having a few problems that I can't figure out. Anyones help would be great. I'm sure I'm making a simple mistake.

error that I receive:
"Parse error: parse error in /home/wrpenner/public_html/submitform.php on line 16"

that actual file (submitform.php)
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<?php
mysql_connect (localhost, #######, #######);

mysql_select_db (wrpenner_contacts);
mysql_query ("INSERT INTO contacts (first_name, last_name, company_name, address_1, address_2, city, state, zip_code, phone_number, fax_number, email)
VALUES ('$first_name', '$last_name', '$company_name', '$address_1', '$address_2', '$city', '$state', '$zip_code', '$phone_number', '$fax_number', '$email')
);
print ($first_name);
print (" ");
print ($last_name);
print ("<p>");
print ("Your submission was complete.");
?>
</body>
</html>

Please tell me what I'm doing wrong. Thank you.

Webpenner

p.s. I know my user name and password should be where the ###'s are. :)

[Edited by webpenner on 01-27-2001 at 10:15 PM]

redranger
01-28-2001, 12:05 AM
Originally posted by webpenner
mysql_query ("INSERT INTO contacts (first_name, last_name, company_name, address_1, address_2, city, state, zip_code, phone_number, fax_number, email)
VALUES ('$first_name', '$last_name', '$company_name', '$address_1', '$address_2', '$city', '$state', '$zip_code', '$phone_number', '$fax_number', '$email')
");[/B]Note the extra double quotes.

HTH.

Graham
01-28-2001, 02:18 AM
I want to laern PHP and MYSQL byt the code posted here, and Iv'e seen elsewhere looks scary!! How hard is it to catch on??

petesmc
01-28-2001, 05:37 PM
PHP / MySQL is extremely easy,

BTW I moved this thread to the coding help section...

webpenner
01-28-2001, 09:06 PM
Duh....I knew I was missing something simple. Thanks for your help! ;)

Webpenner

mark_olson
03-29-2001, 06:39 PM
A great book I just got for learning PHP and MySQL is 'Beggining PHP4', published by Wrox.