I need help with a PHP script code that could export to excel from a Oracle database I am using PHP4
trying to export to excel using PHP and Oracle 9i
Collapse
X
-
From your request I assume that you already have some code done. Show it.Originally posted by harljefI need help with a PHP script code that could export to excel from a Oracle database I am using PHP4
Ronald :cool: -
This is a part of my code, I am connecting to Oracle but I need to export the query I got to a xls file.Originally posted by ronverdonkFrom your request I assume that you already have some code done. Show it.
Ronald :cool:
<tr>
<th height="54" scope="col">
<p align="left"><s trong>Plazo</strong>:
<?
$db_conn=ocilog on("web","web", "maprd1_solaris ") or die("No he podido conectar");
?>
<select name="plazob" id="plazob" value=<?=$plazo ?>>
<?
$cmdst1 = "select * from plazos where codigo=$plazo";
$plazo1 = ociparse($db_co nn, $cmdst1);
ociexecute($pla zo1);
while(OCIFetch( $plazo1)) {
?>
<option value="<?=ocire sult($plazo1,1) ?>">
<?=ociresult($p lazo1,2)?>
</option>
<? }?>
</select>
</p>
</th>
</tr>Comment
-
There is a free class at ADODB SQL 2 Excel .
This class can be used to generate Excel files in the XLS format from database query results.
Ronald :cool:Comment
-
Ronald
Thank you for your help, but what I need actually is pass the info of a php file to a xls file for example if I am making a oracle database query like this
<p align="left"><s trong>Plazo</strong>:
<?
$db_conn=ocilog on("web","web", "maprd1_solaris ") or die("No he podido conectar");
?>
<select name="plazob" id="plazob" value=<?=$plazo ?>>
<?
$cmdst1 = "select * from plazos where codigo=$plazo";
$plazo1 = ociparse($db_co nn, $cmdst1);
ociexecute($pla zo1);
while(OCIFetch( $plazo1)) {
?>
<option value="<?=ocire sult($plazo1,1) ?>">
<?=ociresult($p lazo1,2)?>
</option>
<? }?>
</select>
</p>
be able to pass the value of plazo to a cell of a xls fileComment
-
You either want to make a new file or update an existing one. See the following classes for that (otherwise try the XML group at phpclasses.org) :
Excel WriterExcel XML ParserThis class can generate spreadsheet files in the .xls XML format used by the latest versions of Microsoft Excel.
The class can generate spreadsheet files writing a whole rows at once, or individual row cells one at a time.Ronald :cool:This package can be used to read and write data to Excel worksheets in the Excel XML format.
It can parse an Excel document file in the XML format and create objects to access the file workbook, worksheets, table, cells, etc..
The contents of the document may also be altered and saved to an Excel XML file or served for download.Comment
Comment