PHP and Microsoft SQL 7
| From: | Jari Ivanoff | Date: | Tue, 10 Oct 2000 11:30:49 +0000 |
| Subject: | PHP and Microsoft SQL 7 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19314@lists.php.net to get a copy of this message | ||
I am trying to make an insert into a SQL database via a html form.
It is for a newspage on our intranet.
I think I have got everything working except the insert:
mssql_query("insert into news
values(NULL,'%s-%s-%s','%s','%s','%s')",
$ar,$manad,$dag,$tid,$head,$content) or die("Invalid Query");
I get the following errormessage:
Warning: Wrong parameter count for mssql_query() in c:
\apache\htdocs\news\newsin.php on line 10
Invalid Query
I have tried to use NULL, 0 and nothing at all for the first field.
The $head and $content is passed from the form I use.
The fields in the database is as follows:
id int (unique autoincrement identifier )
date varchar ( the date of the posting yyyy-mm-dd)
time varchar ( the time of the posting hh:mm:ss )
head varchar ( the head of the posting )
content varchar ( the content of the posting )
I generate the time and date in the script since I don't know how to
get the SQL to generate it in the format I want.
In MySQL I could use currentdate() and currenttime(), but since I have
to use MSSQL...
Jari Ivanoff
jari.ivanoff@telia.com
+46-(0)70-3142556