FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » Blank Web Page shows but works well on Command Prompt.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Blank Web Page shows but works well on Command Prompt. [message #24851] Tue, 17 May 2005 09:11 Go to previous message
nayeem is currently offline  nayeem   Saudi Arabia
Messages: 1
Registered: May 2005
Location: Riaydh
Karma:
Junior Member

I'm new to PHP programming and I just try to display small information from database on web page but its shows blank page. So my code is mention below and let me know what's wrong in it but when I execute same program on command prompt then its shows all result correctly with HTML Tags

<?php

PutEnv("ORACLE_SID=TSH1");
PutEnv("ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1");
PutEnv("TNS_ADMIN=/var/opt/oracle");

$db_conn = ocilogon("scott", "tiger", "");

$cmdstr = "select ename, sal from emp";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
echo "Found: $nrows results<br><br>\n";

echo "<table border=1 cellspacing='0' width='50%'>\n";
echo "<tr>\n";
echo "<td><b>Name</b></td>\n";
echo "<td><b>Salary</b></td>\n";
echo "</tr>\n";

for ($i = 0; $i < $nrows; $i++ ) {
echo "<tr>\n";
echo "<td>" . $results["ENAME"][$i] . "</td>";
echo "<td>$ " . number_format($results["SAL"][$i], 2). "</td>";
echo "</tr>\n";
}

echo "</table>\n";

?>


[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: A date question
Next Topic: edit proxy number in header information usgin php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 10:04:12 GMT 2024

Total time taken to generate the page: 0.10970 seconds