It looks like you're trying to use JavaScript style concatenation.
In PHP the period is used to concatenate, not the plus sign.
$username = $HTTP_POST_VARS['username'];
echo $username;
echo "<br>";
$query = "INSERT INTO jpnquiz.users VALUES('";
$query = $query . $username;
$query = $query . "','5','0','0','0')";
echo $query;
echo "<br>";
Is one way of doing it.
$username = $HTTP_POST_VARS['username'];
echo $username;
echo "<br>";
$query = "INSERT INTO jpnquiz.users VALUES('";
$query .= $username;
$query .= "','5','0','0','0')";
echo $query;
echo "<br>";
The .= combination of operators is a shortcut for doing that.
And the best way would be:
$query = "INSERT INTO jpnquiz.users VALUES('".$username."','5','0','0','0')";
-OR- The apostrophe is not a valid variable name character, so $username would be recognized and substituted for the correct variable value within string context.
$query = "INSERT INTO jpnquiz.users VALUES('$username','5','0','0','0')";
-OR- Curly Brace Syntax
$query = "INSERT INTO jpnquiz.users VALUES('{$username}','5','0','0','0')";
All do pretty much the same thing.
See:
http://www.php.net/manual/en/language.types.string.php
Also you do not need to specify the database name when you are inserting into a single table.
$query = "INSERT INTO `users` VALUES('{$username}','5','0','0','0')";
Should also work. (Backticks optional)
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::