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

Reply

Join Date: Jan 2008
Posts: 1
Reputation: nazall is an unknown quantity at this point 
Solved Threads: 0
nazall nazall is offline Offline
Newbie Poster

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

 
0
  #1
Jan 18th, 2008
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";
}


?>
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 62
Reputation: hooray is an unknown quantity at this point 
Solved Threads: 6
hooray hooray is offline Offline
Junior Poster in Training

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

 
0
  #2
Jan 19th, 2008
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 ;
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

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

 
0
  #3
Jan 19th, 2008
Originally Posted by hooray View Post
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.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

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

 
0
  #4
Jan 21st, 2008
$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje'");
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

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

 
0
  #5
Jan 21st, 2008
Originally Posted by ryan_vietnow View Post
$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje'");
You got the " at the wrong place!
  1. $sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje')";
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 187
Reputation: phper is an unknown quantity at this point 
Solved Threads: 15
phper's Avatar
phper phper is offline Offline
Junior Poster

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

 
0
  #6
Jan 25th, 2008
$sql="INSERT INTO $tbl_name VALUES('$pid','$kid', '$pemri', '$pnjm', '$psasia', '$pcmimi', '$pfoto', '$pverejtje')";

The above is what your SQL query should be
If my post is useful please add to my reputation.
Thanks.

Ajtrichards Web Solutions | http://www.ajtrichards.co.uk
Retenovate | http://www.retenovate.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC