- Messages
- 5,508
- Reaction score
- 35
- Points
- 48
Soooo something is wrong again...
I get this error: Parse error: syntax error, unexpected T_VARIABLE in /home/viggeswe/public_html/flash/counterh.php on line 12
Line 12 is
It isn't line 12 here because I deleted the password and username thing at the top.
And yes. Everything I had input in the code is correct. And I have deleted the add hit on this one because I want to count the game plays and not the main page hits.
Edit:
Ok I give 100 credits for the one who fix it
PHP:
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect to server ");
mysql_select_db("$db_name")or die("cannot select DB")
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
$counter=$rows['counter'];
// if have no counter value set counter = 1
if(empty($counter)){
$counter=1;
$sql1="INSERT INTO $tbl_name(counter) VALUES('$counter')";
$result1=mysql_query($sql1);
}
echo $counter;
echo "people has played our games. ";
mysql_close();
?>
I get this error: Parse error: syntax error, unexpected T_VARIABLE in /home/viggeswe/public_html/flash/counterh.php on line 12
Line 12 is
PHP:
$sql="SELECT * FROM $tbl_name";
It isn't line 12 here because I deleted the password and username thing at the top.
And yes. Everything I had input in the code is correct. And I have deleted the add hit on this one because I want to count the game plays and not the main page hits.
Edit:
Ok I give 100 credits for the one who fix it
Last edited: