Text file to Access Database table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hewstone
Forum Newbie
Posts: 14
Joined: Fri Nov 14, 2008 10:57 am

Text file to Access Database table

Post by hewstone »

Hey,

I have a "example.txt" file that contains the following values(The values in the .txt file are subject to change):

01, Richard, Hewston, 55,
02, Fred, smith, 34,
03, Sam, woyhem, 45,


How can i insert this data into a access database using PHP (The common separting the cells)


I connect to the database using this code:

$db_conn = new COM("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("./Database1.mdb").";";
$db_conn->open($connstr);
Post Reply