Can't insert in SQL SERVER 2000/7.0
Posted: Mon Jun 27, 2005 3:49 pm
Hello everyone I'm having some problems with a page I developped in PHP.
I need to insert some records in a database that's located in a MSSQL SERVER 7.0, but everytime I try to make an insert in the database the code doesn't work, here's my code.
The file where the db conecction is configured is the following:
I'm trying to do this:
As I told you I can't insert any records although if I replace the insert for a select, the select is done ok. And I also have to add that if I access the SQL SErver using SQL Query Analizer from SQL SERVER 2000 I can do the inserts properly, so I guess that leaves out any permission problem.
Can anybody help? I can't migrate to a newer version of MSSQL SERVER b/c my app it's a secondary and I really need to make it work in that version.
Hope anyone can help.
I need to insert some records in a database that's located in a MSSQL SERVER 7.0, but everytime I try to make an insert in the database the code doesn't work, here's my code.
The file where the db conecction is configured is the following:
Code: Select all
<?
//db_config.inc.php
$servidor = "172.17.1.67";
$usuario = "sa";
$senha = "sig2";
$banco = "Cortes";
$conex = mssql_connect ($servidor,$usuario,$senha);
mssql_select_db ($banco, $conex);
?>Code: Select all
<?
include "db_config.inc.php";
$sp = "insert into Fechas_cortes values ('2005-10-14')";
$a = mssql_query($sp,$conex);
?>Can anybody help? I can't migrate to a newer version of MSSQL SERVER b/c my app it's a secondary and I really need to make it work in that version.
Hope anyone can help.