php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31120 MS SQL Extension in 4.3.10 doesn't work with FreeTDS 0.62.4 (no inserts)
Submitted: 2004-12-16 12:38 UTC Modified: 2004-12-17 09:31 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: ssc at coolspot dot de Assigned: fmk
Status: Closed Package: MSSQL related
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID:
 [2004-12-16 12:38 UTC] ssc at coolspot dot de
Description:
------------
After upgrading PHP 4.3.9 to 4.3.10,
no inserts are possible in our MS SQL Tables.
Solving the problem means :
1. Switch back to 4.3.9
2. Replace contents of the php-4.3.10/ext/mssql with that from  
4.3.9
I can send you my php_mssql* files for reference.


Expected result:
----------------
Insert data into MS SQL tables

Actual result:
--------------
No inserts


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-16 15:33 UTC] richard dot quadling at bandvulc dot co dot uk
Something similar is happening in V5.0.3 on Windows XP.

I would check that the data is being entered, but the return from the mssql_query() statement is actually False!!!!

E.G.

<?php
$rConn = mssql_connect('localhost','sa','sa');
mssql_select_db('BandvulcForums');
$rResults = mssql_query('SELECT * FROM dbo.Test');
while ($row = mssql_fetch_assoc($rResults))
	{
	echo '<pre>' . var_export($row, True) . '</pre>';
	}
mssql_free_result($rResults);

$bFlag = mssql_query("INSERT dbo.Test VALUES ('Noodle');");

echo "\$bFlag = " . var_export($bFlag, True);

$rResults = mssql_query('SELECT * FROM dbo.Test');
while ($row = mssql_fetch_assoc($rResults))
	{
	echo '<pre>' . var_export($row, True) . '</pre>';
	}
mssql_free_result($rResults);

mssql_close($rConn);
?>

With the table holding names of Sally, Richard and Hesper, the output is ...

array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)
array (
  'ID' => 3,
  'Name' => 'Hesper    ',
)
array (
  'ID' => 12,
  'Name' => 'Noodle    ',
)
$bFlag = false
array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)
array (
  'ID' => 3,
  'Name' => 'Hesper    ',
)
array (
  'ID' => 4,
  'Name' => 'Noodle    ',
)

Which I think is the issue.

I'm having this issue with phpBB.

Richard.
 [2004-12-16 15:34 UTC] richard dot quadling at bandvulc dot co dot uk
Sorry. The CORRECT results for the output is ...

array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)
array (
  'ID' => 3,
  'Name' => 'Hesper    ',
)

$bFlag = false

array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)
array (
  'ID' => 3,
  'Name' => 'Hesper    ',
)
array (
  'ID' => 4,
  'Name' => 'Noodle    ',
)
 [2004-12-16 15:37 UTC] richard dot quadling at bandvulc dot co dot uk
As a proof of a change in the php_mssql.dll extension, I took the same code and ran it through V5.0.3 of php with the V5.0.2 version of php_mssql.dll (after a little bit of hex editing to fool the API release date!).

The output is ...

array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)

$bFlag = true

array (
  'ID' => 1,
  'Name' => 'Richard   ',
)
array (
  'ID' => 2,
  'Name' => 'Sally     ',
)
array (
  'ID' => 3,
  'Name' => 'Hesper    ',
)
array (
  'ID' => 4,
  'Name' => 'Noodle    ',
)

The result from the mssql_query() for the same insert statement is True.

Richard.
 [2004-12-16 22:50 UTC] fmk@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2004-12-17 08:49 UTC] ssc at coolspot dot de
PHP from snap.php.net does not compile.
Configure string was :
'./configure' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php' '--disable-rpath' '--enable-memory-limit' '--disable-debug' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--disable-xml' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-exec-dir=/usr/lib/php4/libexec' '--disable-static' '--with-curl=/usr' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-zlib-dir=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-imap=/usr' '--with-imap-ssl' '--with-ldap=/usr' '--with-mcal=/usr' '--with-mhash=/usr' '--with-mm' '--with-mysql=/usr' '--with-unixODBC=/usr' '--with-recode=/usr' '--enable-xslt' '--with-xslt-sablot=/usr' '--with-snmp' '--enable-ucd-snmp-hack' '--with-mssql=/usr/' '--with-ttf=/usr' '--with-t1lib=/usr'
Last message was :

ext/mssql/php_mssql.lo(.text+0x5cac): In function `zif_mssql_guid_string':
/root/php4-STABLE-200412170530/ext/mssql/php_mssql.c:2257: undefined reference to `min'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Fehler 1

Snap version = php4-STABLE-200412170530
 [2004-12-17 09:31 UTC] sniper@php.net
There is/was a problem with building the snapshots.
Try again later.

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 07:02:06 2014 UTC