Simple T_VARIABLE problem with SQL insert
Posted: Tue Jun 27, 2006 6:54 pm
This is driving me nuts! I'm sure its something glaring that I'm just missing. Problematic line is marked with '***'
returns this
Code: Select all
<?php
$header = rand(1, 2);
$username = $_GET['newusername'];
$joindate = $_GET['newjoindate'];
$rank = $_GET['newrank'];
$em = $_GET['newemail'];
$link = mysql_connect("localhost", "xxx_xxx", "xxxx") or die("Could not connect : " . mysql_error());
mysql_select_db("fatalpre_members") or die("Could not select database");
$query = "INSERT INTO `roster` ( `id` , `username` , `joindate` , `rank` , `email` ) VALUES ( NULL , '$username', '$joindate', '$rank', '$em' );"
*** $result = mysql_query($query) or die("Query failed : " . mysql_error());
?>returns this
Code: Select all
Parse error: parse error, unexpected T_VARIABLE in /home/fatalpre/public_html/insert.php on line 11