GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 26-Mar-2007, 14:26
pembomassive pembomassive is offline
New Member
 
Join Date: Mar 2007
Posts: 11
pembomassive is on a distinguished road
Exclamation

Parse error: parse error, unexpected '}' in online 19


hi this error is driving me crazy this form is to update into a db soem prob on line 19 tried adding a } before line 19 nothing changed

PHP Code:

<?php
$con = mysql_connect("localhost","markpemberton","fowler");
if (!$con){('Could not connect: ' . mysql_error());}
else
{
mysql_select_db("multiple_choice", $con);

$sql="INSERT INTO guest (guestNo, firstName, lastName, gender, country, county, email)
VALUES
('$_POST[guestNo]','$_POST[firstName]','$_POST[lastName]')','$_POST[gender]','$_POST[country]','$_POST[county]','$_POST[email]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con)
?>

Last edited by LuciWiz : 27-Mar-2007 at 01:12. Reason: Please insert your Php code between [php] & [/php] tags
  #2  
Old 26-Mar-2007, 14:54
pembomassive pembomassive is offline
New Member
 
Join Date: Mar 2007
Posts: 11
pembomassive is on a distinguished road

Error: You have an error in your SQL syntax; check the manual that corresponds to you


changed abit an getting this???????????

PHP Code:

<?php
$con = mysql_connect("localhost","markpemberton","fowler");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("multiple_choice", $con);

$sql="INSERT INTO guest (guestNo, firstName, lastName, gender, country, county, email)
VALUES
('$_POST[guestno]','$_POST[firstname]','$_POST[lastname]')','$_POST[gender]','$_POST[country]','$_POST[county]','$_POST[email]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con);
?>

Last edited by LuciWiz : 27-Mar-2007 at 01:18. Reason: Please insert your Php code between [php] & [/php] tags
  #3  
Old 27-Mar-2007, 01:22
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,032
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: Parse error: parse error, unexpected '}' in online 19


Action taken : [Merged threads]
  #4  
Old 27-Mar-2007, 07:07
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Parse error: parse error, unexpected '}' in online 19


So, pembomassive, is there still a problem? Post the exact error message.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #5  
Old 27-Mar-2007, 09:16
markyp markyp is offline
New Member
 
Join Date: Nov 2006
Posts: 26
markyp is on a distinguished road

Re: Parse error: parse error, unexpected '}' in online 19


got it working cheers
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI sph2005 MySQL / PHP Forum 11 17-Jul-2006 10:28
Parse Error vigilantweather MySQL / PHP Forum 6 04-Feb-2006 14:15
PaySwiss, Pay online, Accept Credit Cards, Earn 50% of Fees! adhoc eCommerce / Merchant Account Forum 2 06-Feb-2005 06:53

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:27.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.