Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-10-2003, 09:46 PM
baddai's Avatar
Novice Webmaster
 
Join Date: Sep 2003
Location: Sarawak
Posts: 18
Rep Power: 0
baddai is on a distinguished road
Send a message via Yahoo to baddai
Excel ke MySQL

cam maner aku nak pindahkan database aku dari excel kree MySQL dengan cara yang lebih murah.. aku search untuk converter, tapi semua ne berbayar... ade cara lain kree nak pindahkan data aku tu..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-10-2003, 11:07 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
I don't really know a simple way to do this, but a way I do it is import the Excel data to a MS Access database, which is done by using File > Get External Data > Import

Once you have imported excel to a MS Access database, you can create a php script to do all the grabbing and dumping. You could use something like below. It's some code I wrote to import data from excel sheets to MySQL.

However, there might be easier ways to do it, try searching on google or something.

PHP Code:
<?php
// This opens up the Access database using ODBC
$cnx odbc_connect('exchange','root','');
// This selects the table in your Access database
$result odbc_exec($cnx"SELECT * FROM Country");

// The standard loop thing
while ($myrow odbc_fetch_row($result)) {
    
// Connect your your MySQL database
    
$db mysql_connect("localhost""root""");
    
// Select your MySQL database
    
mysql_select_db("hc_system"$db);
    
// The below 2 lines insert the grabbed data (from Access) into MySQL
    
$sql "INSERT INTO country (CountryCode,Country,Region,Currency,CurrencyCode) VALUES ('" odbc_result($result2) . "','" odbc_result($result3) . "','" odbc_result($result6) . "','" odbc_result($result5) . "','" odbc_result($result4) . "')";
    
$result2 mysql_query($sql);
    
// This just prints what has been dumped
    
echo "Done - " odbc_result($result2) . "<br>";
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-11-2003, 10:18 AM
DingDang's Avatar
Normal User
 
Join Date: Jul 2001
Location: eRakan.Net
Posts: 118
Rep Power: 92
DingDang is on a distinguished road
Send a message via ICQ to DingDang Send a message via Yahoo to DingDang
..or you can convert your excel data into CSV (comma seperated value) and import it into mysql using mysql gui such as Sqlyog or mysqlFront.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET - DataGrid Export to Excel - Alignment problem genzy Website Programming 2 15-04-2007 11:21 AM
mcmana nak export excel ke mysql poshberry Website Programming 15 04-06-2004 04:29 PM
can excel VBA 97 be converted to XML? ymhy_80 Website Design 1 26-02-2004 01:15 PM
convert excel vba to webpage ymhy_80 Websites Review and Suggestion 1 20-02-2004 11:50 AM
transfer excel filr to powerpoint khairudin Mamak Stall 1 21-07-2003 01:16 PM


All times are GMT +8. The time now is 03:24 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61