Jump to content

rawrtiger

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rawrtiger's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you!
  2. I'd like to have a table that has all my site options in it (eg. Site Name, Site URL, etc.) and then an easy way to define variables from it in PHP. I currently have the table structured like so: ID _|_ Setting _|_ Value 1 | setting1 | a 2 | setting2 | b 3 | setting3 | c 4 | setting4 | d I'd like a file that will select each value and define it as a variable in PHP so I can use the variables in my other files. This is what I'm doing for now but it's not a very good way to do it: $result = mysql_query("SELECT * FROM config WHERE site_option = 'setting1'"); while($row = mysql_fetch_array($result)) { $pagetitle = $row['value']; } $result = mysql_query("SELECT * FROM config WHERE site_option = 'setting2'"); while($row = mysql_fetch_array($result)) { $siteurl = $row['value']; } What would be a better way to do it?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.