Hello Adrian,

There are some concurrency issues with mssql if you are using
mssql_pconnect. Try switching to mssql_connect. Also check to see if
transactions are enabled in mssql.

Your SQL insert syntax looks ok.

Regards, John

PS: for porting mysql to mssql, have a look at http://php.weblogs.com/adodb
for the ADODB database wrapper library.


""Adrian Jurjica"" <[EMAIL PROTECTED]> wrote in message
001401c0bd38$51d05580$[EMAIL PROTECTED]">news:001401c0bd38$51d05580$[EMAIL PROTECTED]...
Can anyone help me?
Today I was informed that the backend for my project will not be MySQL, but
MSSQL 7.0. No problems, I said, but after porting database from MySQL to
MSSQL I find that the UPDATE statement doesn't work. Strange is that INSERT
statement in a php query does not work second time (ie, i made a script for
taking records from MySQL and insert in MSSQL; first query work, but second
doesn't).
Code is here:

my_update("update sometable set col1=".$var1." where col2=".$var2);

and function:

function my_update($query){
    global $host,$user,$psw,$name;
    $conn=mssql_pconnect($host,user,psw) or die("Error: connection
failed!");
    $rdb=mssql_select_db($name,$conn) or die("Error: DB does not exist");
    $rez_q=mssql_query($query,$conn) or die("Error: Invalid SQL");
}

The same code and function work fine in MySQL. Why doesn't work in MSSQL
Server???

Adrian JURJICA
================================
Tel.: +40-94-128879
E-mail: [EMAIL PROTECTED]
================================
Nu ocoliti pe Internet:
http://oneblackcat.f2s.com
http://www.terrasat.ro
http://www.transcondor.com
http://aimmr.go.ro
================================




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to