You are here: Parse error: parse error, unexpected T_STRING, expecting ',' or « All PHP « IT news, forums, messages
Parse error: parse error, unexpected T_STRING, expecting ',' or

Posted by mike on 01/08/06 11:35

I'm getting the following error on this line,
(last, first, address) VALUES('$last', '$first', '$address' ) ")

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
/home/xxxxxx/public_html/process1.php on line 22

I copied the code from an example, not sure if it can be done like
this, it didn't use the $values, just text, if you guys know a better
way I'm open for suggestions.

The Example:
// Insert a row of information into the table "example"
mysql_query("INSERT INTO example
(name, age) VALUES('Timmy Mellowman', '23' ) ")
or die(mysql_error());

many thanks in advance

<html><body>
<?php
mysql_connect("localhost", "xxxxxxx", "xxxxxxx") or
die(mysql_error());
mysql_select_db("xxxxxx_customer") or die(mysql_error());

$first = $_POST['first'];
$last = $_POST['last'];
$address = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$email = $_POST['email'];
echo "First Name: ". $first . "<br />";
echo "Last Name: ". $last . "<br />";
echo "Address: ". $address . "<br />";
echo "City: ". $city . "<br />";
echo "Zip Code: ". $zip . "<br />";
echo "Phone: ". $phone . "<br />";
echo "email: ". $email . "<p />";
echo "This is the information you submitted

mysql_query("INSERT INTO information
(last, first, address) VALUES('$last', '$first', '$address' ) ")
or die(mysql_error());

echo "Data Inserted!";
?>
</body></html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация