• 0

Converting Cutenews to Mysql


Question

Hey,

Ok, basically i want to convert all my news from cutenews in to a mysql database, if you didnt know cutenews is stored in a txt file called news.txt,

I was just looking at it, and its layed out like this:

unixtime|username|title|shortstory|longstory||||

So, first is the unix time, then | then username who submitted it, then |, then news title, then |, then short story, then |, then longstory, and then each article is seperated by ||||,

Now, how do i get it to explode them, and then put each one as a variable?

i.e. what is the code to explode it, and then make each one a variable? i.e unixtime, username etc.?

Thanks, Tim

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Once you've read the text file, you can use explode("|",$values), then insert them into a database, and use mysql_fetch_array to read them from the DB. I'd recommend wordpress though, it uses MySQL and has loads of features.

Link to comment
Share on other sites

  • 0

Well considering you have little knowledge of PHP, I would suggest that you just find yourself a ready made news script that uses a mySQL database and just insert all of your news into it. By looking at your site you don't have to worry about the comments, or lack thereof.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.