General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old July 21st, 2002, 11:25 PM
dave89 dave89 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 3 dave89 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Tables, 2 fields, or Multiple Fields?

im goin to have an admin area where they can change background colorz etc... in doing this, everything will be in a database (MYSql)

Is it better to have the data in seperate fields or have 2 fields... 1 field for as the "name" and then the 2nd field for the "data"? If I have only 2 fields, then would I have to filter it out - what would be the best way to do this?? Should I use seperate tables?

Reply With Quote
  #2  
Old July 21st, 2002, 11:29 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
if its in ASP, the most common way of doing these configuration is using server includes

so set a variable in a file called

config.inc

like

BackColor="#CCCCCC"
BorderColor="White"

and in your page, put

<body bgcolor="<%=BackColor%>">

make sure at the top of each page you add

<!--#Include file = "config.inc"-->
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
  #3  
Old July 22nd, 2002, 08:22 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
ahh i get what your saying, its like my site, ive got the prefrences not in a file, but in my database, so its easy to create a prefrence page thingy in da admin

the database structure is like this

id | name | value

then its easy! w00p. soz need 2 sleep

Reply With Quote
  #4  
Old July 22nd, 2002, 08:25 AM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
If your doing that, then what i would do is load them up as your application variables that way ur round trip to the database is minimized

Reply With Quote
  #5  
Old July 22nd, 2002, 08:43 PM
dave89 dave89 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 3 dave89 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ben, If I have the database structure as you say - this would mean that I'd have to filter the database?? So that when I want the bgcolor prefrence.. i would need to filter "bgcolor" in the "name" field?

Do you have an asp sample code so that I can see what you mean?

Reply With Quote
  #6  
Old July 22nd, 2002, 08:59 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Lindset Send a message via AIM to Lindset
What you can do is loop through the query results and put the options in associative arrays
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #7  
Old July 22nd, 2002, 09:15 PM
dave89 dave89 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 3 dave89 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What if I rang the whole table through a look and set them as session Variables? Would it use up too much memory? eg.

<%
strConn = "Driver={Mysql}; Server=203.2.7.2; Database=dbtest; UID=ffff; PWD=ffff"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConn
strSQL="select * from tblSettings"
set rs=objConn.Execute(strSQL)
rs.movefirst

while not rs.eof
Session(rs("Name")) = rs("setas")
rs.movenext
wend

rs.close
objconn.close
set rs = nothing
set objconn = nothing
%>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Tables, 2 fields, or Multiple Fields?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway