freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR
- From: Mattia <mattia AT p2pforum.it>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR
- Date: Mon, 11 Jul 2011 10:33:44 +0200
2011/7/11 Frediano Ziglio:
> 2011/7/9 Mattia:
>> So,
>> with SYBVARCHAR an empty string is inserted (in presence of strange
>> characters);
>> with SYBNVARCHAR, sql server throws an error (unknown data type)
>> with XSYBNVARCHAR, everything works perfectly.
>>
>
> Could you provide a simple PHP code which demonstrate the problem?
> Have you the problem inserting data or fetching them? Did you setup
> correctly client charset?
>
The problem is inserting data. Fetching them works fine.
Client charset is UTF-8.
Php code is pretty simple:
<?php
$conn = mssql_connect($hostname, $db_user, $db_pass ) or die ( "Unable
to connect" );
mssql_select_db($db_name) or die("$db_name not found");
$an_id = 1;
$the_string="This would result Ő in an empty string";
$stmt = mssql_init('My_Stored_Proc');
mssql_bind ($stmt, '@string', $the_string, SQLVARCHAR, false, false);
mssql_bind($stmt, '@id', $an_id, SQLINT4, false, false);
$result=mssql_execute($stmt) or die('Stored proc execution failed');
mssql_free_statement($stmt);
mssql_close($conn);
?>
Id gets inserted and mssql_execute returns true. The string is empty.
Db is a Sql 2008 R2 Web Edition (with the standard edition is the same).
--
Mattia
-
[freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/04/2011
- Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR, Mattia, 07/04/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Frediano Ziglio, 07/07/2011
- Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR, Ken Collins, 07/07/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/09/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Frediano Ziglio, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Frediano Ziglio, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/11/2011
- Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR, Frediano Ziglio, 07/13/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Frediano Ziglio, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Mattia, 07/11/2011
-
Re: [freetds] FreeTDS and PHP: empty strings and NVARCHAR,
Frediano Ziglio, 07/11/2011
Archive powered by MHonArc 2.6.24.