Im having a little bit of a problem with php Im getting an error
"Parse error: syntax error, unexpected T_STRING in /home1/krisando/public_html/Data.php on line 16"
I have no clue whats wrong 🙁 The php file is
<?php
$cmd=$_GET['cmd'];
$sec=$_GET['sec'];
$key=$_GET['key'];
$val=$_GET['val'];
$ret=1;
// Make a MySQL Connection
mysql_connect("HOST", "USERNAME", "PASSWORD") or die(mysql_error());
mysql_select_db("DATABASE") or die(mysql_error());
// Create a MySQL table in the selected database
//netvaron! id,gameid,var,val
CREATE TABLE IF NOT EXISTS `netvaron`
(
`id` int(11) NOT NULL auto_increment,
`gameid` varchar(10) default NULL,
`var` varchar(1000) default NULL,
`val` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=506;
// Insert a row of information into the table "netvaron"
if ($cmd==w){
mysql_query("DELETE FROM netvaron WHERE gameid='".$sec."' AND var='".$key."'")
or die(mysql_error());
mysql_query("INSERT INTO netvaron
(gameid, var ,val) VALUES('".$sec."', '".$key."' ,'".$val."') ")
or die(mysql_error());
echo '1';
}
if ($cmd==r){
// Retrieve all the data from the "netvaron" table
$result = mysql_query("SELECT * FROM netvaron WHERE gameid='".$sec."' AND var='".$key."'
ORDER BY id DESC")
or die(mysql_error());
// store the record of the "netvaron" table into $row
$row = mysql_fetch_array( $result );
// Print out the contents of the entry
echo $row['val'];
}
?>