Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to display a .txt file stored in DataBase

New Here ,
May 03, 2011 May 03, 2011

Hi,

I'm using Dreamweaver (PHP/MySQL) using Xampp as a server, on a mac plateforme : Intel - Snow leopard 10.6.7.

I made up a database using phpMyadmin : It looks like this :

Artistes names          @pictures                              Biographies

artiste 1                    images/picture1.jpg               1- Lorem ipsum dolor sit amet........

artiste 2                    images/picture2.jpg                2- Lorem ipsum dolor sit amet........

and so on....

Now Calling the Database & using the Bindings, I get everything working fine!

My Question is :

I want to use text file in the Biographies field : so instead of inserting the text directly in my database, I would like to use .txt files.

My database will look like this :

Artistes names          @pictures                              Biographies

artiste 1                    images/picture1.jpg               file1.txt

artiste 2                    images/picture2.jpg               file2.txt

and so on...

How to make the textes inside the .txt files, show up in my page, as the pictures do!, and do I have to add the "@" before "Biographies" as with "@pictures".

Any Help Please?

Thank U.

TOPICS
Server side applications
473
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 04, 2011 May 04, 2011
LATEST

Depending on the length of the files you could use file_get_contents to print the string.  Or you can use the fopen, fread, fclose commands.  Links are below.  How much data are we talking about and is there HTML that needs to be parsed in the text file or is it all plain text?

http://www.php.net/manual/en/function.file-get-contents.php

http://www.php.net/manual/en/function.fread.php

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines