Questions tagged [php-mssql]

A PHP extension which allows you to access Microsoft SQL Server databases. It was available until PHP 5.3 (on Windows) and removed in PHP 7.0.0.

54 questions
1
vote
2 answers

Blank integer passed into PHP makes my stored proc bind fail

So I have this code: $pfname = $input->get('pfname','','filter'); $state = $input->get('states'); $retCode=0; $saveVendorProc = mssql_init("createVendorProc",$conn); mssql_bind($saveVendorProc , "@VendorName", $pfname ,…
Will
  • 465
  • 1
  • 3
  • 12
1
vote
0 answers

PHP + MSSQL : Could not find stored procedure - but it is there

Here is my code on PHP: $stmt = mssql_init('postget', $conn); mssql_bind($stmt,'@IDPost',$IDPOST,SQLINT4); if ($result = mssql_execute($stmt)) { while ($row = mssql_fetch_assoc($result)){ echo $row["Content"]; } } I'm recieving the…
Libania Paes
  • 53
  • 1
  • 6
1
vote
4 answers

mssql_bind empty string converting to NULL

I am currently using SQL Server 2000 Stored Procedures with PHP. Following the PHP doc, I use mssql_bind to assign value of parameters and then execute the Stored Procedure. The problem is that I got this bug which prevents me to bind empty strings…
MaxiWheat
  • 6,133
  • 6
  • 47
  • 76
1
vote
1 answer

MSSQL Stored Procedure has rows, but mssql_num_rows returns 0

I'm having a really strange problem with some PHP and MSSQL that I'm working with. I'm working with stored procedures to retrieve information that a user has just stored into the database so that they can print out a record of their entry. Initially…
Karen Dixon
  • 43
  • 1
  • 4
1
vote
1 answer

mssql_bind and fatala error only variable can be passed by reference

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); //…
Fixus
  • 4,631
  • 10
  • 38
  • 67
1
vote
3 answers

Passing date as input parameter to mssql stored procedure through PHP

I am trying to run an mssql stored procedure which passes in some user entered data. I run the stored procedure directly and it works fine but when I try to run it using the attached code I get no error and nothing updates. I think it is something…
Steve Smith
  • 734
  • 6
  • 14
  • 29
1
vote
1 answer

The formal parameter was not declared as an output parameter - SQL Server & PHP

I'm having a problem with a stored procedure from SQL Server with PHP. I'm working on a system that takes order lines, generates an order header and then places the order lines into the SQL Server database. Everything is going fine, until I try to…
Karen Dixon
  • 43
  • 1
  • 4
1
vote
1 answer

Getting output parameter from stored procedure

I'm trying to get the stored procedure to fire and return the output parameter as well as the result set. Currently I just get the result set array with a balnk variable where the output parameter should be. //initiate function $proc =…
Steve Smith
  • 734
  • 6
  • 14
  • 29
0
votes
2 answers

PHP / MSSql How to preview a stored procedure

We are executing a stored procedure against an MSSQL database with PHP. When we hand build the stored procedure and execute it manually with Navicat we get the correct results. When we build the query and execute it with PHP we get a different…
teamcolab
  • 9
  • 2
0
votes
1 answer

Error passing parameter to MSSQL Stored Procedure from PHP

I am trying to call a MS SQL SP from a php script. When I tried calling the procedure which required an parameter as input (hardcoded the parameter for now ), it failed. The code is below: $link = mssql_connect('xx.xx.xx.xx', 'xx',…
Joe
  • 1
0
votes
0 answers

How to insert emoji into SQL Server using PHP and mssql_connect?

I'm trying to insert emoji into NVARCHAR(MAX) column from PHP but I get error. The same query executed by SQL Server client works fine so the problem is query/connection size. INSERT INTO table (text) VALUES (N' example') I get error: Incorrect…
Lorenzo
  • 41
  • 9
0
votes
0 answers

Have old php web how change mssql to sqlsrv all

$host = "MyIP"; $alogin = "user"; $apass = "password"; $db = "mydatabase"; $msconnect=mssql_connect("$host","$alogin","$apass"); $msdb=mssql_select_db("$db",$msconnect); I tried to change, I think it works, but it's…
0
votes
2 answers

INSERT INTO not working one table but works on others & update works too?

My PHP/SQL script does not work on the new table I cloned but works perfectly fine on the table I copied the new table from using this: SELECT * INTO slide FROM news Here's my insert form:
Amenadiel
  • 173
  • 1
  • 3
  • 9
0
votes
0 answers

Cant Connect Using Mssql Pconnect

Code of config Line 5 = `if (!($link=mssql_pconnect("zzzzz\xxxx","sa","sssssss")))` error is Warning: mssql_pconnect() [function.mssql-pconnect]: Unable to connect to server: zzzzz\xxxx in C:\xampp\htdocs\web\config\config.php on line 5 my…
Mark Well
  • 1
  • 1
0
votes
1 answer

DirectAdmin, Multple PHP Versions and MSSQL

In the past I have setup connections to MSSQL by using the MSSQL functions. I have an old site (client is refusing to upgrade) that runs php 5.5, sadly the functions have gone missing (it was working but now isn't) I've tried to re-install using…
Neo
  • 2,305
  • 4
  • 36
  • 70