2017-02-01 03:10:37 +01:00
|
|
|
--TEST--
|
|
|
|
Field metadata unicode
|
|
|
|
--SKIPIF--
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
2017-10-04 23:22:56 +02:00
|
|
|
require_once("MsCommon.inc");
|
2017-02-01 03:10:37 +01:00
|
|
|
|
2017-10-04 23:22:56 +02:00
|
|
|
// connect
|
|
|
|
$conn = connect(array("CharacterSet"=>"UTF-8"));
|
|
|
|
if (!$conn) {
|
|
|
|
fatalError("Connection could not be established.\n");
|
2017-05-02 02:01:30 +02:00
|
|
|
}
|
2017-02-01 03:10:37 +01:00
|
|
|
|
2017-05-03 01:26:32 +02:00
|
|
|
$tableName = 'test_srv_034';
|
2017-02-01 03:10:37 +01:00
|
|
|
|
|
|
|
// Create table. Column names: passport
|
|
|
|
$sql = "CREATE TABLE $tableName (पासपोर्ट CHAR(2), پاسپورٹ VARCHAR(2), Διαβατήριο VARCHAR(MAX))";
|
|
|
|
$stmt = sqlsrv_query($conn, $sql);
|
|
|
|
|
|
|
|
// Prepare the statement
|
|
|
|
$sql = "SELECT * FROM $tableName";
|
|
|
|
$stmt = sqlsrv_prepare($conn, $sql);
|
2017-05-03 01:14:55 +02:00
|
|
|
|
|
|
|
// Get and display field metadata
|
|
|
|
$metadata = sqlsrv_field_metadata($stmt);
|
2017-10-04 23:22:56 +02:00
|
|
|
if (! $metadata) {
|
|
|
|
printErrors();
|
|
|
|
} else {
|
2017-05-03 00:58:43 +02:00
|
|
|
var_dump($metadata);
|
2017-10-04 23:22:56 +02:00
|
|
|
}
|
2017-02-01 03:10:37 +01:00
|
|
|
|
2017-05-03 01:26:32 +02:00
|
|
|
sqlsrv_query($conn, "DROP TABLE $tableName");
|
|
|
|
|
2017-02-01 03:10:37 +01:00
|
|
|
// Free statement and connection resources
|
|
|
|
sqlsrv_free_stmt($stmt);
|
|
|
|
sqlsrv_close($conn);
|
|
|
|
|
|
|
|
print "Done"
|
|
|
|
?>
|
|
|
|
|
|
|
|
--EXPECT--
|
2017-05-03 00:39:45 +02:00
|
|
|
array(3) {
|
|
|
|
[0]=>
|
|
|
|
array(6) {
|
|
|
|
["Name"]=>
|
|
|
|
string(24) "पासपोर्ट"
|
|
|
|
["Type"]=>
|
|
|
|
int(1)
|
|
|
|
["Size"]=>
|
|
|
|
int(2)
|
|
|
|
["Precision"]=>
|
|
|
|
NULL
|
|
|
|
["Scale"]=>
|
|
|
|
NULL
|
|
|
|
["Nullable"]=>
|
|
|
|
int(1)
|
|
|
|
}
|
|
|
|
[1]=>
|
|
|
|
array(6) {
|
|
|
|
["Name"]=>
|
|
|
|
string(14) "پاسپورٹ"
|
|
|
|
["Type"]=>
|
|
|
|
int(12)
|
|
|
|
["Size"]=>
|
|
|
|
int(2)
|
|
|
|
["Precision"]=>
|
|
|
|
NULL
|
|
|
|
["Scale"]=>
|
|
|
|
NULL
|
|
|
|
["Nullable"]=>
|
|
|
|
int(1)
|
|
|
|
}
|
|
|
|
[2]=>
|
|
|
|
array(6) {
|
|
|
|
["Name"]=>
|
|
|
|
string(20) "Διαβατήριο"
|
|
|
|
["Type"]=>
|
|
|
|
int(12)
|
|
|
|
["Size"]=>
|
|
|
|
int(0)
|
|
|
|
["Precision"]=>
|
|
|
|
NULL
|
|
|
|
["Scale"]=>
|
|
|
|
NULL
|
|
|
|
["Nullable"]=>
|
|
|
|
int(1)
|
|
|
|
}
|
|
|
|
}
|
2017-10-04 23:22:56 +02:00
|
|
|
Done
|