Hi,

I have the following stored procedure call working fine with MSSQL and Windows. But now I am trying to use the same logic with odbc_connect from a Linux box to a SQL database. I think instead of mssql_execute I need to use obdc_execute, but I don't know how to change the rest of this statement to work with obdc_execute. It seems that odbc_init and odbc_bind are not valid arguments.

Can someone help me translate this into an acceptable odbc_connect call?

$sp = mssql_init("sp_encrypt_text"); // stored proc name

mssql_bind($sp, "@unencrypted", ($extpassword), SQLVARCHAR, false, false, 255);
mssql_bind($sp, "@return_encrypted", ($extpassword), SQLVARCHAR, true, false, 255);

mssql_execute($sp);

Thanks!

    Update:

    I've made some progress on writing this statement with the ODBC_Connect terminology, but I am struggling with telling it to return my desired result ($parm2).

    Here is where I am:

    $callsp = "{call sp_encrypt_text}";
    $parm1 = $extpassword;
    $parm2 = $extpassword;
    @odbc_exec ($callsp, $parm1, $parm2);
    $extpassword = odbc_result($callsp,$parm2);

    Suggestions?

      Write a Reply...