Monday, February 20, 2012

NULL issue

I have a PHP web form that takes data and posts it to the SQL database.
Instead of a record number being assigned to the first column of each row,
the database displays <NULL> in the column. How can I get the record number
to display in the database?
When I run my second PHP script, it retreives the data from the database. It
needs to display the data with the database record number, but instead
displays <NULL>.
$tday = date('Ymd');
$name2 = $HTTP_POST_VARS["name"];
$empNum = $HTTP_POST_VARS["empNum"];
$email = $HTTP_POST_VARS["email"];
$deptSta2 = $HTTP_POST_VARS["deptSta"];
$subject2 = $HTTP_POST_VARS["subject"];
$comments2 = $HTTP_POST_VARS["comments"];
$mailList = $HTTP_POST_VARS["mailList"];
$result=odbc_exec($connection,"INSERT INTO contact VALUES(NULL, '$tday',
'$name2', '$empNum', '$email', '$deptSta2', '$subject2', '$comments2',
'$mailList', 'N')");what is the first column? and wht does the insert or update stmnt look like?
"Npeart1" wrote:

> I have a PHP web form that takes data and posts it to the SQL database.
> Instead of a record number being assigned to the first column of each row,
> the database displays <NULL> in the column. How can I get the record numbe
r
> to display in the database?
> When I run my second PHP script, it retreives the data from the database.
It
> needs to display the data with the database record number, but instead
> displays <NULL>.
> $tday = date('Ymd');
> $name2 = $HTTP_POST_VARS["name"];
> $empNum = $HTTP_POST_VARS["empNum"];
> $email = $HTTP_POST_VARS["email"];
> $deptSta2 = $HTTP_POST_VARS["deptSta"];
> $subject2 = $HTTP_POST_VARS["subject"];
> $comments2 = $HTTP_POST_VARS["comments"];
> $mailList = $HTTP_POST_VARS["mailList"];
>
> $result=odbc_exec($connection,"INSERT INTO contact VALUES(NULL, '$tday',
> '$name2', '$empNum', '$email', '$deptSta2', '$subject2', '$comments2',
> '$mailList', 'N')");
>

No comments:

Post a Comment