We help IT Professionals succeed at work.
Get Started

Read a file to MySQL table

moellert asked
Last Modified: 2010-07-27
My program is generating a long text file line by line. After it has finished the text file is saved to the disk.
For a new option I need to get the content of the text file into a table of MySQL database.
SQL command would be something like:
INSERT INTO parameter (mac_address, conf_parameter) VALUES ("."'".$mac_address."', '".$conf."')
I am looking for the $conf variable. How do I get the content of the text file in this variable?
Or is there a different way to get it into my DB?

Thanks a lot
Watch Question
Web developer
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE