thenature4u Posted February 11, 2008 Share Posted February 11, 2008 culd you explain the code for insertind data from text file into mysql database using php. ex: data.txt this file contains below details. name:XXX office: mobile: email:[email protected] name:XXX office: mobile: email:[email protected] name:XXX office: mobile: email:[email protected] these details insert into database table structure is( name office mobile email) please explain this Link to comment https://forums.phpfreaks.com/topic/90468-reading-data-from-text-file-and-insert-into-database-using-php/ Share on other sites More sharing options...
yandoo Posted February 11, 2008 Share Posted February 11, 2008 Hi there, This is basic notepad file of a User table and records that are inputed auto via phpmyadmin but includes the creation of the tables as well.... You should hopefully be able to reverse engineer it... -- phpMyAdmin SQL Dump -- version 2.10.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Feb 05, 2008 at 07:59 PM -- Server version: 5.0.45 -- PHP Version: 5.2.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `woodside` -- -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(4) NOT NULL, `FirstName` varchar(25) NOT NULL, `LastName` varchar(25) NOT NULL, `Age` int(3) NOT NULL, `Hometown` varchar(25) NOT NULL, `Job` varchar(25) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `FirstName`, `LastName`, `Age`, `Hometown`, `Job`) VALUES (1, 'Peter', 'Griffin', 41, 'Quahog', 'Brewery'), (2, 'Loise', 'Griffin', 40, 'Newport', 'Piano Teacher'); Unless i have gotthe wrong end of the stick here???? Link to comment https://forums.phpfreaks.com/topic/90468-reading-data-from-text-file-and-insert-into-database-using-php/#findComment-464242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.