Announcement

Collapse
No announcement yet.

How can i execute sqlsrv_query function

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can i execute sqlsrv_query function

    I need to execute a query using sqlsrv_query function in SC-7.

    For example :
    /* Execute the query. agaunst SQL Server*/
    $stmt = sqlsrv_query($conn, $tsql, $params);


    How can i get the scriptcase Global connection variable to the Database $conn ?


    Thanks in advance..

  • #2
    I think that should do it.

    $serverName = [sc_glo_servidor];
    $connectionInfo = array( "Database"=>[sc_glo_banco], "UID"=>[sc_glo_usuario], "PWD"=>[sc_glo_senha] );
    $conn = sqlsrv_connect( $serverName, $connectionInfo);

    jsb
    Last edited by jsbinca; 08-13-2014, 11:23 PM.

    Comment


    • #3
      You can too:
      sc_lookup(qry, "SELECT * FROM TABLE", "conn_mssql")

      where conn_mssql is the connection defined on SC.
      /Giuseppe

      Professional Scriptcase Services
      Some Customers opinions

      Comment

      Working...
      X