Can't to insert data ( via variable ) into MS-SQL
| From: | edwardspl at ita dot org dot mo | Date: | Fri, 26 Mar 2004 15:42:52 +0000 |
| Subject: | Can't to insert data ( via variable ) into MS-SQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181559@lists.php.net to get a copy of this message | ||
Dear All,
There is a sample that can't to insert any data ( via variable ) in
MS-SQL :
insert.php:
<form action="save.php" method="post">
<table border="0" align=center>
<input type="text" size="20" name="name" maxlength="8"
value="<? echo
$GBName ?>"><br>
Job<input type=text" size="16" name="job"><br>
Subject<input type="text" size="30" name="subject"><br>
<input type="submit" value="SubMit">
</center>
</table>
</form>
save.php:
<a href=view.php">Search data</a>
</body>
</html>
<?
$date=date('Y-m-d H:i:s');
$link = mssql_pconnect("sql","sa","1234");
mssql_select_db("phpbook",$link);
$str = " INSERT INTO staff (name,job,subject)
VALUES('$name','$job','$date','$subject',)";
mssql_query($str,$link);
?>
After insert data by using save.php, I found no any data from the
Database system ( MS-SQL ), but I sure the Database System is no problem
!
So, how can I fix this kind of problem ( Sorry, I'm not familar with php
) ?
Many thank for your help !
Edward.