I wasn't sure whether to put this in Databases or here, but since this would be my first PHP written from scrath I will put it here. I decided to create a form that I could put on my website that would save values to my MySQL database. I created the tables and rows etc. but whenever I run the PHP I get this error:
Parse error: parse error, unexpected T_STRING in /home2/chaos/public_html/droplog.php on line 7
Here is the PHP that I wrote:
<?
$host='localhost';
$username='chaos';
$password='9C+6g=6c+9G';
$database='chaos_droplog';
$table='droplog';
mysql_connect($host, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
$ip = getenv ( 'REMOTE_ADDR' );
$unit_name = $_GET['unit_name'];
$date_month = $_GET['date_month'];
$date_day = $_GET['date_day'];
$time_hour = $_GET['time_hour'];
$time_minute = $_GET['time_minute'];
$add_all = 'INSERT INTO $table;
values('$ip','$unit_name','$date_month','$date_day','$time_hour','$time_minute');
?>
I removed the obvious values that would comprimise security.
The bolded line is line 7.
You can see the error here.