Click to See Complete Forum and Search --> : Parse Error detected but I can't find it.


shmeeps
12-20-2004, 10:50 PM
Okay, I've been working on a script to make it easier for me to add things into my SQL database, but I get a parse error on line 33. The only thing there is the code
?>
Here is the whole script
<b>Create Monster Script:</b>
<form action="<?php echo ($PHP_SELF); ?>" method=post">
ID: <input type="text" name="ID" size="10">
Name: <input type="text" name="name" size="50"><br>
Health: <input type="text" name="Health" size="11"><br>
Attack: <input type="text" name="Attack" size="11"><br>
Defense: <input type="text" name="Defense" size="11"><br>
Speed: <input type="text" name="Speed" size="11"><br>
Money: <input type="text" name="Money" size="11"><br>
Items: <input type="text" name="Items" size="100"><br>
<input type="submit" value="Submit">
</form>
<?php
if( $id and $name and $Health and $Attack and $Defense and $Speed and $Money and $Items )
{
$user = "*USER*";
$conn = mysql_connect("localhost", $user, "*password*");
$rs = mysql_select_db("*Database*", $conn);
$sql = $sql = 'INSERT INTO `Enemies` (`ID`, `Name`, `Health`, `Attack`, `Defense`, `Speed`, `Money`, `Items`)
values ( $ID, \"$name\", \"$Health\", \"$Attack\", \"$Defense\", \"$Speed\", \"$Money\", \"$Items\" );
$rs = mysql_query( $sql , $conn);
if($rs){
echo("Enemy Added: $ID");
echo("$name");
echo("$Health");
echo("$Attack");
echo("$Defense");
echo("$Speed");
echo("$Money");
echo("$Items");
{
}
?>
Can anyone help?

EDIT: Sorry, I meant it was a
"Unexcpected $ at line 33"
Error

Jona
12-21-2004, 02:53 AM
echo("$Items");
}