Home All Groups Group Topic Archive Search About
Author
12 Jan 2006 8:34 PM
Npeart1
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')");

Author
12 Jan 2006 9:47 PM
HP
what is the first column? and wht does the insert or update stmnt look like?
Show quote
"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 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')");
>
>

AddThis Social Bookmark Button