1

I want to invoke a mssql procedure via php

$link = mssql_connect($this->serverName, $this->user, $this->password);
    mssql_select_db($this->db);

    // Create a new statement
    $stmt = mssql_init($this->owner . '.buf_ins_pilot', $link);

    // Bind values here
    // (polaczenie, nazwa, wartosc, typ, output, null)
    mssql_bind($stmt, "@ach_kod_systemu", "", SQLVARCHAR);

And I get

Fatal error: Only variables can be passed by reference

It`s on line with mssql_bind. I'm looking whole day solution for that and I don't know what am I doing wrong. It's almoust copy/paste from php manual

Zhorov
  • 28,486
  • 6
  • 27
  • 52
Fixus
  • 4,631
  • 10
  • 38
  • 67

1 Answers1

2

Ofc I should read more ceraful. Damn I was reading same thing whole day and didn`t notice it

It should look like this

$variable = "";
mssql_bind($stmt, "@ach_kod_systemu", $variable, SQLVARCHAR);
Fixus
  • 4,631
  • 10
  • 38
  • 67
  • Just had the same error while doing a hello world style equivalent based on the manual. Fortunately I found your Q&A after about 5 minutes. – Dan Jun 12 '13 at 15:31