MSSQL, SOAP, PHP

A

Anonymous

Guest
you can use

Code:
<?php

if ($res = mssql_query($sql)) {
  // successfull query
} else {
  // false
}

?>
 
Also if your first IF statement doesn't work, consenquently, your mssql_select_db() wont work too because of the link identifier ($db_link).
So like ruturajv example... try working around those IF statements... I bet it would be something related to it.
 
Yep i understood and thats a weird problem... thats why sometimes we got to play with code to better fit our needs.
Try something like:
Code:
<?
class SQL {
  // .....
  function SELECT($sql, $db) {
     $db_link = (mssql_connect('MUHA','root','pseto')) ? 1 : 0;
     if(!$db_link){
        // ...same problem
     }else {
        $db_s = (mssql_select_db($db, $db_link)) ? 1 : 0;
        $return[0] = 'OK';
        return new SOAP_Value('return','{urn:SQL}ArrayOfStrings', $return);
     }
        
     if(!$db_s) {
        $return[0] = 'failed';
        return new SOAP_Value('return','{urn:SQL}ArrayOfStrings', $return);
     }

  }
  // .....
}
// ....
?>
I really can't see a reason for this problem. Actually the only thing which seems to be causing this are the IF's statements.

--
Out from job now, so got to sleep, but... will take a better look at this problem ASAP.
 
doesnt have to be a BUG.. it could simply be the way mssql package works and you should seriously read through whe documentation for that package and see the differences..
 
you need to specify the port 1433
soe
Code:
<?php
mssql_connect(192.168.0.23:1433, 'usrename', 'password'); // for linux
mssql_connect(192.168.0.23,1433, 'usrename', 'password'); // for windows
?>
 
Back
Top