954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

emergency please help fo Parse error: syntax error, unexpected T_STRING

this is the php code for me that gives me error

Parse error: syntax error, unexpected T_STRING in C:\xampplite\htdocs\eurofrit\insert_ac.php on line 35

i will be thankfull if someone helps me because for days i can't fix it

<?php

$host="localhost";
$username="";
$password="";
$db_name="member";
$tbl_name="produktet";

// konoktimi ne server dhe zgjedhja e bazes
$conn=mysql_pconnect("$host", "$username", "$password");
$select=mysql_select_db("$db_name", $conn);

// marim vlerat nga forma
$pid=$_POST['pid'];
$kid=$_POST['kid'];
$pemri=$_POST['pemri'];
$pnjm=$_POST['pnjm'];
$psasia=$_POST['psasia'];
$pcmimi=$_POST['pcmimi'];
$pfoto=$_POST['pfoto'];
$pverejtje=$_POST['pverejtje'];


// Insertojm te dhena ne mysql
$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje');
$result=mysql_query($sql);

// nese eshte e sukseshme inserto te dhena ne databaze dhe jep mesazh se eshte kryer me sukses
if($result){

echo "GOOD";
}

else {
echo "ERROR";
}


?>

nazall
Newbie Poster
1 post since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

I dont know if it is as simple as this, but you have left out a " at the end of your $sql = part before the ;

hooray
Junior Poster in Training
62 posts since Jan 2008
Reputation Points: 11
Solved Threads: 6
 
I dont know if it is as simple as this, but you have left out a " at the end of your $sql = part before the ;

:) Absolutely right.

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje'");

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 
$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje'");

You got the " at the wrong place!

$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje')";
nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje')";

The above is what your SQL query should be

phper
Posting Whiz in Training
213 posts since Nov 2006
Reputation Points: 22
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You