나는 finnaly 대신 내 odbc_exec에 보낼의 솔루션은() SELECT * FROM MyTable
같은 쿼리, 나는이 기능을 만들어 기능을 발견 : 우리가하는 데 사용으로
$SQLCodePrep = "SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'MyTable'";
$result=odbc_exec($conn, $SQLCodePrep);
$ColumnList = QueryPrompter::InsertIntoArray($result);
# This function take as argument the result of a query and put each row in an array, and each of these arrays in a bigger array (wich represent the table)
$SQLCode = "SELECT ";
for ($i=0; $i<count($ColumnList); $i++)
{
if (in_array($ColumnList[$i][1], $DefaultArray = array('ntext', 'text', 'image')) OR (in_array($ColumnList[$i][1], $DefaultArray = array('nvarchar', 'varchar')) AND $ColumnList[$i][2] == '-1'))
{
$Column = "RTRIM(CAST(".$ColumnList[$i][0]." AS VARCHAR(8000))) AS '".$ColumnList[$i][0]."'";
}
else
{
$Column = $ColumnList[$i][0];
}
if($i < count($ColumnList)-1)
{
$Column .= ", ";
}
$SQLCode .= $Column;
}
$SQLCode .= " FROM MyTable";
그런 다음 우리가 $result=odbc_exec($conn, $SQLCode);
을 수행 할 수 있습니다 및 모든으로 작동 내가 원했던 것
'ntext_field'는 더 이상 사용되지 않습니다. 그것을'nvarchar (max)'로 변경하고 다시 시도 하시겠습니까? – gotqn