代码如下 ,谁懂,帮看看 谢谢
<?php$db_conn = ocilogon( "root", "222222","tests" );$cmdstr = "select Gal, Gal_id from Gall";$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);$nrows = ocifetchstatement($parsed, $results);echo "<html><head><title>Oracle PHP Test</title></head><body>";
echo "<center><h2>Oracle PHP Test</h2><br>";
echo "<table border=1 cellspacing='0' width='50%'>\n\<tr>\n";
echo "<td><b>Name</b></td>\n<td><b>Salary</b></td>\n</tr>\n";for ($i = 0; $i < $nrows; $i++ ) 
{
    echo "<tr>\n";
    echo "<td>" . $results["Gal"][$i] . "</td>";
    echo "<td>$ " . number_format($results["Gal_id"][$i],   2). "</td>";
    echo "</tr>\n";}echo "<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>";
echo "<br><em>If you see data, then it works!</em><br></center></body></html>\n";?>

解决方案 »

  1.   

    我来拯救你
    在选择数据库时加上mysql_query("SET NAMES 'UTF-8'");
      

  2.   

    如果你数据表编码为gbk就写GBK
      

  3.   

    在数据写入数据库之前加上mysql_query ("set names 'GBK'");是GBK‘ ’里就写GBK,是UTF8就写UTF8,看你写入的数据是什么类型的了
      

  4.   

    用iconv("incharset","outcharset","str").
      

  5.   

    我用的是oracle数据库,怎么弄啊