473,408 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

trying to export to excel using PHP and Oracle 9i

I need help with a PHP script code that could export to excel from a Oracle database I am using PHP4
Jan 5 '07 #1
5 7976
ronverdonk
4,258 Expert 4TB
I need help with a PHP script code that could export to excel from a Oracle database I am using PHP4
From your request I assume that you already have some code done. Show it.

Ronald :cool:
Jan 5 '07 #2
From your request I assume that you already have some code done. Show it.

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.

<tr>
<th height="54" scope="col">

<p align="left"><strong>Plazo</strong>:
<?
$db_conn=ocilogon("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_conn, $cmdst1);
ociexecute($plazo1);

while(OCIFetch($plazo1)) {
?>
<option value="<?=ociresult($plazo1,1)?>">
<?=ociresult($plazo1,2)?>
</option>
<? }?>
</select>
</p>


</th>
</tr>
Jan 5 '07 #3
ronverdonk
4,258 Expert 4TB
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:
Jan 5 '07 #4
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"><strong>Plazo</strong>:
<?
$db_conn=ocilogon("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_conn, $cmdst1);
ociexecute($plazo1);

while(OCIFetch($plazo1)) {
?>
<option value="<?=ociresult($plazo1,1)?>">
<?=ociresult($plazo1,2)?>
</option>
<? }?>
</select>
</p>


be able to pass the value of plazo to a cell of a xls file
Jan 5 '07 #5
ronverdonk
4,258 Expert 4TB
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 Writer
This 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.
Excel XML Parser
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.
Ronald :cool:
Jan 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table....
8
by: Jerome Ranch | last post by:
Okay So I've got pivot tables setup in Access 2003. Only about 30K records in the current 2005 databases...the pivots summarize the info in a number of nice ways. I need to get the pivot tables...
14
by: bonehead | last post by:
Greetings, I'm using the DoCmd.TransferText method to export the results of a MS Access query to a csv file. The csv will then be used to load an Oracle table. In other systems such as TOAD...
3
by: jelinjose | last post by:
Hi, I have created a table with table name T1 with a particular schema. I have entered the data in an excel sheet in the particular schema above and saved as T2.dmp file. I would like to know...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
8
by: alexianet | last post by:
Hi. I would like to make an export from an Oracle database to excel but I do not know how. Could anyone please help me? I have tried this: Public Function ExportOracleTableToExcel(ByVal strTable...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
5
by: sumanta123 | last post by:
Dear Sir, How to export/import the excel file in oracle database using sql promt. Please guide me the command(export/import) for the neddful. Thanks in Adavance. Regards Sumanta Panda
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.