I noticed that Message-ID:
<I6*********************@news-text.cableinet.net> from MeerKat contained
the following:
Is there a way to import MS Access into MySQL? Maybe create a CSV or
something. If so, what would be the SQL to do this?
Try a MySQL group.
But there is a php answer. I found this bit of code which works. (though
I note that mysql_db_query() is deprecated.
I export from access using a semicolon as separator save it as query.txt
then run this.
<?php
# MySQL database User ID, Password and DB name
$sql_id = "userid";
$sql_pwd = "pwd";
$sql_db = "database_name";
$table = "table_name";
$infile = "query.txt";
# Connect to the database
mysql_connect('mysqldb.gradwell.net',$sql_id,$sql_ pwd);
# Delete the current content of the table
$result = mysql_db_query($sql_db,"DELETE FROM $table") or die ("Invalid
DELETE query");
# Optimize the current table (recover empty space)
$result = mysql_db_query($sql_db,"OPTIMIZE TABLE $table") or die
("Invalid OPTIMIZE query");
# Load local comma separated, fields enclosed by quotes text database -
File has to be in the same directory of this file
$result = mysql_db_query($sql_db,"LOAD DATA LOCAL INFILE '$infile' INTO
TABLE $table FIELDS TERMINATED BY ';' ENCLOSED BY ''") or die ("Invalid
DATA LOAD query");
# Get how many records are present in the table now
$result = mysql_db_query($sql_db,"SELECT * from $table") or die
("Invalid SELECT query");
$rows_count = mysql_num_rows($result);
echo "Records: $rows_count"; mysql_free_result($result);
?>
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs
http://www.ckdog.co.uk/rfdmaker/