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
https://forums.phpfreaks.com/topic/71955-solved-help-unknown-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.