Thread: PHP Question
View Single Post
  #5   Spotlight this post!  
Unread 11-06-2004, 15:49
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: PHP Question

Quote:
Originally Posted by HHSJosh
I do have access to three MYSQL databases, but I haven't yet learned how to interface with MYSQL yet. Also, I use the array_reverse() function to read the newest news from the top of the file, I just need some way where I can just get the newest five stories to display.
Hm...maybe seperate each item by underscores or something, and scan the file for it, and each time it's found, fill an array w/ the info and also use a counter. An example:
PHP Code:
// number of news items read
$num_news 0;
 
// global array defined here
 
// open file for reading
$file fopen("news.txt""r");
 
// read file
$stuff fread($file);
 
// loop through the reading
while(($num_news 5) && ($stuff != eof())){
/* store news items in an array...I'm not sure on howto do this, so... */

__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"