Closed Thread Icon

Topic awaiting preservation: Flat File DB Pages that link to <a href="http://ozoneasylum.com/backlink?for=12381" title="Pages that link to Topic awaiting preservation: Flat File DB" rel="nofollow" >Topic awaiting preservation: Flat File DB\

 
Author Thread
AT
Bipolar (III) Inmate

From: Louisville, KY, USA
Insane since: Aug 2000

posted posted 08-25-2002 08:19

I have a question, and I keep telling myself that the only stupid question is the one not asked... but I'm lying, so here we go!

I want to be able to create a flat file database...
the first word of each line will be a name, which will be unique...
I'll be seperating with pipes '

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-25-2002 17:20

AT: Keep your eye on this :
www.gurusnetwork.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic;f=12;t=000132

Did that solution I sent not help?

___________________
Emps

FAQs: Emperor

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-25-2002 17:48

http://dbx.idya.net/


AT
Bipolar (III) Inmate

From: Louisville, KY, USA
Insane since: Aug 2000

posted posted 08-25-2002 18:18

Hey Emps, yeah what you sent me helped in what I was doing at the time...
I was just pulling out all the info... and thanks for the URL...

and Max, thanks to you as well, just d/l it, and I'm reading

but is there a way to just use a regular txt file, and have PHP pull a line of it depending upon the name at the beginning?

Reason I ask, is not because this DBX wont work for me, but because I want to learn if it's possible with the basics first... learning the hard way has been a weakness of mine, but my old bosses liked it because I knew what I was talking about...

thanks guys, you rock

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 08-25-2002 19:22

You'll have to write yourself a function that does this for you.
Basicially, you'll have to loop through all your entries and return those that match your request. Forget about using sql though.
then you can use explode() on your data to turn it into an array...

AT
Bipolar (III) Inmate

From: Louisville, KY, USA
Insane since: Aug 2000

posted posted 08-25-2002 19:27

sounds good Mr. Prime *grin*

My prob right now is that I don't know how to do that, so my question should of been how can I do something to the equivalent of my SQL above...

I'm new to PHP, and I've never messed with flat files, and I've had a hard time finding something actually doing what I want to try

thanks, all post are very appreciated

AT
Bipolar (III) Inmate

From: Louisville, KY, USA
Insane since: Aug 2000

posted posted 08-25-2002 22:21

Hey guys, this works wonderfully...

<BLOCKQUOTE><FONT face="Verdana, Arial">code:</font><HR><pre>

<?php

$file = "test.txt";

$name_len = strlen($name);
$lines = file($file);
foreach ($lines as $line) {

if (substr($line, 0, $name_len) == $name) {
$name_var = rtrim($line);

$line_array = explode("

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 08-26-2002 09:28

mr. Max, thanks for sharing the DBX site, it looks interesting!

« BackwardsOnwards »

Show Forum Drop Down Menu