Some of your single quotes between values are missing (the . "','" . ),
messing up the query.
However it would probably be easier to do the addslashes() beforeyou do the
query so you don't have to break the query up like that.

So I'd do it like this:
}else{
// Insert new entry

$Name = addslashes($Name);
$Description = addslashes($Description);
$FileName = addslashes($FileName);
$Redirect = addslashes($Redirect);

 $query = "INSERT INTO Downloads (Name, Description, FileSize, FileName,
DownloadCount, Category, Redirect) VALUES ('$Name', '$Description',
'$FileSize', '$FileName', '$DownloadCount', '$Categories', '$Redirect')";
}


Thor M. Steindorsson - [EMAIL PROTECTED]
http://www.netwood.net - Find Out Why We're Better.


-----Original Message-----
From: Darren Evans [mailto:d_evans*@earthlink.net]
Sent: Wednesday, January 24, 2001 1:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help with INSERT query


I recently downloaded a phpDownload app.  I'm having problems with it and
can not reach the creator of this app.

The INSERT query from the Admin portion of this app will not insert the info
passed from a form.   Can someone offer any help with this?

Here is a portion of the code:

} else {
// Insert new entry
 $query = "INSERT INTO Downloads (Name, Description, FileSize, FileName,
DownloadCount, Category, Redirect) VALUES ('";
 $query .= addslashes($Name) . "','" . addslashes($Description) . "'," .
$FileSize . ",'" . addslashes($FileName) . "'," . $DownloadCount . "," .
$Categories . ",'" . addslashes($Redirect) ."')";

 }

Darren Evans
Senior Site Coordinator
www.bombs-away.net




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to