Jump to content

[SOLVED] help unknown syntax error


cs1h

Recommended Posts

Hi,

 

Can anyone help me solve the following error, I'm sure it will be really basic but I am unable to see it. The error is

 

Parse error: syntax error, unexpected '}' in D:\Inetpub\vhost\myroho.com\httpdocs\adding_countryprofile.php on line 6

 

and the code is,

 

<?php 

//This gets all the other information from the form 
$country=$_POST['country'];
$flag=$_POST['flag'];
$text1=$_POST['text1'];
$medical=$_POST['medical']; 
$top1=$_POST['top1'];
$top2=$_POST['top2']; 
$top3=$_POST['top3']; 
$top4=$_POST['top4'];
$top5=$_POST['top5'];  
$bot1=$_POST['bot1'];
$bot2=$_POST['bot2']; 
$bot3=$_POST['bot3']; 
$bot4=$_POST['bot4'];
$bot5=$_POST['bot5'];
$map=$_POST['map']; 
$languages=$_POST['languages']; 
$currency=$_POST['currency'];

// Connects to your Database 
mysql_connect("localhost", "zzz", "xxx") or die(mysql_error()) ; 
mysql_select_db("countryfile") or die(mysql_error()) ; 

//Writes the information to the database 
mysql_query($sql = "insert into `countryfile` (`country`, `flag`, `blurb`, `medical`, `top1`, `top2`, `top3`, `top4`, `top5`, `bot1`, `bot2`, `bot3`, `bot4`, `bot5`, `map`, `languages`, `currency`) values ('$country', '$flag', '$text1', '$medical', '$top1', '$top2', '$top3', '$top4', '$top5', '$bot1', '$bot2', '$bot3', '$bot4', '$bot5', '$map', '$languages', '$currency')");  

//Tells you if its all ok 
echo "ok"; 

} 
else { 

//Gives and error if its not 
echo "didnt work"; 
} 
?>

 

Any help is much appriciated,

 

Thanks

Colin

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.