Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Constant Variables

by powerhouse (Friar)
on Mar 28, 2003 at 05:45 UTC ( [id://246404]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Constant Variables
in thread Constant Variables

Would it be easier to just us a "flat file" type of database?

I think it might be easier to just use a seperate file called something like settings.config and then in the admin interface, make it where when the edit the settings, it just OPENS it, and gets the variables that way, then it can re-write the file everytime the administrator updates the values.

I know how to do that. I just thought it might be faster to just put them in my MySQL database. Of course, If I'm only requiring a config file, then it would probably be faster then running through a database and trying to assign variables.

At least in the config file I could make it look like this:
$default_font_family = "whatever"; $default_font_color = "whatever2";
Do you think that would be easier? I'm starting to feel that way, since there does not seem to be an easy way to do it with a Database. At least from what I seen thus far.

thx,
Richard

Replies are listed 'Best First'.
Re: Re: Constant Variables
by The Mad Hatter (Priest) on Mar 28, 2003 at 13:17 UTC
    Yes, since it is just config, a flat file would probably be easier to do, although if you really wanted, I think it is possible to do the MySQL thing (looping through and binding each column is the way to go, I think).

    If you defined the variables in the config file like you said, all you would have to do is a do filename; and you'd have the variables.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://246404]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found