我从头开始创建网站,我是PHP/html的新手。但我想知道为什么我无法让我的列名显示在我的表格中,而我正在显示在我的页面上。这只是一个简单的查询,看看我是否做得正确。它显示和更新像它应该但列名称。在网站上显示oracle查询
$stid = oci_parse($conn, 'SELECT a.artist_name as artists, g.genre_name as genre
FROM artists a, genre g
WHERE a.genre_id = g.genre_id');
//prepare
if (!$stid) {
$e = oci_error($conn);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// logic
$r = oci_execute($stid);
if (!$r) {
$e = oci_error($stid);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
// fetch
echo "
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
echo "
\n";foreach ($row as $item) {
echo "
" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "\n";}
echo "
\n";}
echo "
\n";oci_free_statement($stid);
oci_close($conn);
?>