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 12PHP Code:// 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();
?>
Line 12 isIt isn't line 12 here because I deleted the password and username thing at the top.PHP Code:$sql="SELECT * FROM $tbl_name";
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


LinkBack URL
About LinkBacks



Reply With Quote

