kensington Posted June 16, 2007 Share Posted June 16, 2007 I have a PHP web page that has a web link where I click on the web link (called myPage.php) and it pulls up a Word Document Report that displays Oracle Database records and it works great if the records are under 25 records. If over 25 then the Word Document comes up blank. The records are very small and cant figure out why it wont work if over 25 records. Here is my PHP code to pull up the Word Doc in myPage.php: <?php $fname="report.doc"; $handle = fopen( $fname, "rb" ); $buf = fread( $handle, filesize( $fname )); fclose( $handle ); $len = strlen( $buf ); header( "Pragma: public" ); header( "Cache-Control: private" ); header( "Connection: close" ); header( "Content-Type: application/msword" ); header( "Content-Length: $len" ); header( "Content-Disposition: inline; filename=\"$fname\"" ); print $buf; ?> <table border="1"> <tr> <td>FieldOneHeader</td> <td>FieldTwoHeader</td> <td>FieldThreeHeader</td> <td>FieldFourHeader</td> <td>FieldFiveHeader</td> </tr> <?php //Oracle DB Connection username and password etc here $s = OCIParse($connection. "select * from theTable"); OCIExecute($s, OCI_DEFAULT); while (OCIFetch($s)) { print '<tr><td>' . ociresult($s, "FIELDONENAME") . '</td>'; print '<td>' . ociresult($s, "FIELDTWONAME"). '</td>'; print '<td>' . ociresult($s, "FIELDTHREENAME"). '</td>'; print '<td>' . ociresult($s, "FIELDFOURNAME"). '<td>'; print '<td>' . ociresult($s, "FIELDFIVENAME"). '</td></tr>'; } print '</table>'; ?> I cant download any softare in my environment due to many restrictions so I have to use what comes with the PHP standard load. Please advise how I can get this to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.