|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
php mysql excel
is it possible to use php mysql microsoft excel combination to design a database driven website.because i already have excel documents so it will be hard work to start all over with mysql
|
|
#2
|
||||
|
||||
|
You'll just need to create the tables in mysql. Then you can import the data by slurping in delimited files exported from Excel.
|
|
#3
|
|||
|
|||
|
Hi.
I would be sure to look at "Advanced PHP for the World Wide Web" by Larry Ullman. He has a good section on Excel and PHP in there. Also, it is one of the best PHP books out there, and I highly recommend it. Take a look at http://us4.php.net/com. There's some good stuff.... As far as I know (I could be wrong), PHP with Excel support will only work on Windows. So, it will work on your own machine, but probably not on a Linux server. Sorry ![]() Also, if more than one person uses a Excel sheet at one time, it could get currupted. So you should look at MySQL (www.mysql.com) which will work on both Windows and Linux. Last edited by pentapenguin : August 20th, 2003 at 07:53 PM. |
|
#4
|
|||
|
|||
|
in reply to dhouston php excel
Quote:
dhouston please explain your answer in more detail so i can understand |
|
#5
|
||||
|
||||
|
An Excel document is typically composed of rows and columns. So is a mysql table. In order to get your data into mysql, you'll need to create a mysql table whose structure (row and column types) corresponds to the structure of the Excel spreadsheet. You can then export your Excel document as a delimited file and import it into your mysql database using command line tools that ship with mysql. I seldom have occasion to do this and so don't have the commands at my fingertips, but you can research them at mysql.com. I believe PHPMyAdmin has tools that'll allow you to import delimited files without having to know anything about the command line interface to mysql.
If your data won't change much over time, you could also just export your spreadsheet as tab-delimited text and write code that'll parse the file and display results without having to use mysql at all. I don't recommend this, though, because it's not as clean or as functional has having a real database. |
|
#6
|
|||
|
|||
|
Quote:
I suppose,'Mysqlimport' command in mysql is the answer to your problem. Here is an example for that Here is a sample session that demonstrates use of mysqlimport: shell> mysql -e 'CREATE TABLE imptest(id INT, n VARCHAR(30))' test shell> ed a 100 Max Sydow 101 Count Dracula . w imptest.txt 32 q shell> od -c imptest.txt 0000000 1 0 0 \t M a x S y d o w \n 1 0 0000020 1 \t C o u n t D r a c u l a \n 0000040 shell> mysqlimport --local test imptest.txt test.imptest: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0 shell> mysql -e 'SELECT * FROM imptest' test +------+---------------+ | id | n | +------+---------------+ | 100 | Max Sydow | | 101 | Count Dracula | +------+---------------+ For more info refer:URL You can also use fgetcsv function in php to parse a delimited file . refer URL for more info. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > php mysql excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|