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:
  #1  
Old July 22nd, 2002, 12:25 AM
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 22nd, 2002, 12:29 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: 8
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, 09: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, 09: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: 8
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, 09: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, 09: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: 8
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, 10: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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek