yssirhc
04-07-2009, 01:10 PM
I keep getting different error messages after I try to fix this. It's driving me mad! Does anyone know the proper way to write this? When I try it this way, it seems to give messages about quotes being wrong.
$sql = "INSERT into Bugs VALUES (
. NULL
. $dbhandle->quote($formHash{"problem"})
. $dbhandle->quote($formHash{"product"})
. $dbhandle->quote($formHash{"version"})
. $dbhandle->quote($formHash{"type"})
. $dbhandle->quote($formHash{"severity"})
. $dbhandle->quote($formHash{"description"})
. $dbhandle->quote($formHash{"user"})
. $dbhandle->quote($formHash{"submittedDate"})
. $dbhandle->quote($formHash{"status"})
. NULL
. )";
This code:
$sql = "INSERT into Bugs VALUES ("
. $dbhandle->quote($formHash{"problem"})
. $dbhandle->quote($formHash{"product"})
. $dbhandle->quote($formHash{"version"})
. $dbhandle->quote($formHash{"type"})
. $dbhandle->quote($formHash{"severity"})
. $dbhandle->quote($formHash{"description"})
. $dbhandle->quote($formHash{"user"})
. $dbhandle->quote($formHash{"submittedDate"})
. $dbhandle->quote($formHash{"status"})
. ")";
seemed to work, except for the fact that it didn't have enough parameters for the table that it's putting the info in. which is why I'm adding the null values.
$sql = "INSERT into Bugs VALUES (
. NULL
. $dbhandle->quote($formHash{"problem"})
. $dbhandle->quote($formHash{"product"})
. $dbhandle->quote($formHash{"version"})
. $dbhandle->quote($formHash{"type"})
. $dbhandle->quote($formHash{"severity"})
. $dbhandle->quote($formHash{"description"})
. $dbhandle->quote($formHash{"user"})
. $dbhandle->quote($formHash{"submittedDate"})
. $dbhandle->quote($formHash{"status"})
. NULL
. )";
This code:
$sql = "INSERT into Bugs VALUES ("
. $dbhandle->quote($formHash{"problem"})
. $dbhandle->quote($formHash{"product"})
. $dbhandle->quote($formHash{"version"})
. $dbhandle->quote($formHash{"type"})
. $dbhandle->quote($formHash{"severity"})
. $dbhandle->quote($formHash{"description"})
. $dbhandle->quote($formHash{"user"})
. $dbhandle->quote($formHash{"submittedDate"})
. $dbhandle->quote($formHash{"status"})
. ")";
seemed to work, except for the fact that it didn't have enough parameters for the table that it's putting the info in. which is why I'm adding the null values.