Writting in MSSQL
| From: | Santhyago B. Gallªo | Date: | Mon, 24 Jun 2002 12:15:54 +0000 |
| Subject: | Writting in MSSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20035@lists.php.net to get a copy of this message | ||
Good morning, List,
Could somebody help me with the following problem?
When I call the function:
$sql= mssql_query("declare @temp numeric(9) set @temp =
(SELECT MAX(reqNumero)FROM requisicao)+1 insert into
requisicao
(reqNumero,codCliente,reqDataOpen,reqIP,reqHost,reqCriticidade
,reqCateg,reqDescricao,reqClosed) values
(@temp,'$codCliente','$data_abertura','$ip','$host_user','$cri
ticidade','$categoria','$descricao','0')");
The program starts writing in the database (M$SQL) and
doesn't stop until I stop the service of database and PWS.
The partial-full code is:
switch ($acao) {
case 'salvar':
$con=mssql_pconnect($host,$user,$pass);
mssql_select_db($banco);
$sql= mssql_query("declare @temp numeric(9) set
@temp = (SELECT MAX(reqNumero)FROM requisicao)+1 insert into
requisicao
(reqNumero,codCliente,reqDataOpen,reqIP,reqHost,reqCriticidade
,reqCateg,reqDescricao,reqClosed) values
(@temp,'$codCliente','$data_abertura','$ip','$host_user','$cri
ticidade','$categoria','$descricao','0')");
header("Location: $PHP_SELF?acao=salvo");
break;
}
Tks,
//--
Santhyago B. Gallão
e-mail: santhy@uol.com.br
ICQ: 9708192
MSN: gallaum@hotmail.com
---
UOL na Copa 2002 - As principais notícias estão em UOL Esporte
http://esporte.uol.com.br/copa/