WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to access MS Excel spread sheets from PHP
Categories : PHP, Excel, ODBC, Databases
Boaz Yahav
Date : Jul 28th 1999
Grade : 3 of 5 (graded 10 times)
Viewed : 34819
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

1. You must have the Excel ODBC driver in your ODBC32 Control
Panel Entry. Don't ask me how and when it gets installed: I
just used the one I found in a pretty stock installation :)

2. Configuration of the ODBC driver: add a DSN choosing the
Excel driver and give it a name (i.e. "excelsux" :)).
Point it to an existing worksheet.

3. In the worksheet select a range of cells then Insert->Name->Define
(YMMV, my Excel is in Italian) and give a name to the
selection (i.e. "myselection").

4. PHP code finally: :)

/* Didn't try to protect it via user/pwd */
if (($id = odbc_pconnect("excelsux"))) {
if (($r = odbc_exec($id, "SELECT * FROM myselection"))) {
odbc_result_all($r); // Or whatever you want
}
}

Problems as of now:

1. the field name is tricky somehow. The first field name is the first
value in the first column of your selection (and if there are spaces
you are into troubles). Also note that your first row shouldn't contain
any data since it's supposed to contain the field names. The problem
I encountered traversing the field names was that I always got just
the first one... any solution or hint is much appreciated :)

2. no INSERTs or UPDATEs, according to M$ documentation :/ But you
are free to pipe your results to any PHP supported DB :)


(Gianugo)



This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server.
Categories : Databases, MySQL, Complete Programs, PHP, Databases
Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions
Categories : PHP Classes, ODBC, Databases, PHP
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Dynamic WHERE CLAUSE depending on number of FORM FIELDS
Categories : ODBC, General SQL, PHP, Complete Programs, Databases
How to connect to MS SQL 6.x+ database server via ODBC functions of PHP3 compiled with iODBC and Openlink drivers under Linux.
Categories : Databases, MS SQL Server, PHP, ODBC
Modification of Shane Caraveo's guestbook. Uses ODBC...some code modifications
Categories : ODBC, Databases, Complete Programs, PHP
This is Yet Another Sql Abstraction Library. Include it in your script and you can use the most important SQL functions without worrying about the SQL backend.
Categories : Databases, PHP, ODBC, MySQL, PostgreSQL
A set of functions sitting on top of the abstraction layer that makes it a little easier to do SQL stuff. Documentation is within
Categories : Databases, ODBC, Complete Programs, PHP
Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0.
Categories : Databases, PHP, mSQL, Databases
db2tab.php - Simple scripts to access IBM DB2 Universal DataBase tables through PHP ODBC funtions.
Categories : Databases, PHP, ODBC
ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL, Oracle, Interbase,ODBC, Microsoft Access and FoxPro.
Categories : PHP Classes, Databases, PHP, General SQL, ODBC
Data Retrieve from Mysql using AJAX with PHP
Categories : PHP, AJAX, Date Time, Databases, MySQL
Simple PHP Form Auto Generation based on MySQL query
Categories : PHP, Form Processing, Databases, MySQL, Sessions
Message of the Day - Random Message (Needs MySQL!)
Categories : Databases, HTML and PHP, PHP, MySQL
StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i
Categories : OCI8, Oracle, Databases, PHP
 vo binh wrote : 792
revert :
How I can output ASP to MS Exel ? Please
 
 Piers Karsenbarg wrote :999
In answer to binh vo, to output into an excel table, all you need to do is have: 

Response.ContentType = "application/vnd.ms-excel"

at the top of your script, then you just output normal HTML-style tables (i.e. new table: <table>, new row: <tr>, new cell: <td>) and thats all there is to it.