Page 3 of 3
Posted: Wed Jul 26, 2006 5:45 pm
by adamb10
jamiel wrote:So there is only one row in the Settings Table?

[/img]
Posted: Wed Jul 26, 2006 7:27 pm
by adamb10
My brain caught up finally.

I decided to start fresh and turn errors on. The errors pointed out that fields in the query dont even belong to that table. I made a new query and now it's fixed!
I still wonder if the where clause is useful though...
Posted: Wed Jul 26, 2006 10:42 pm
by RobertGonzalez
A where clause is useful for any table that has more than one row (which most do). If you do not specify a where, then the entire table updates with the information passed to it.
Posted: Thu Jul 27, 2006 8:04 am
by adamb10
I do use a where clause in scripts that have an id table but nothing else.
Posted: Thu Jul 27, 2006 10:35 am
by RobertGonzalez
Not trying to take this too far off topic, but database table design best practices suggest that all tables have a primary key 'id' field of some sort. You may want to look into developing your tables with id fields. All of my tables have them in some capacity.
Posted: Thu Jul 27, 2006 11:11 am
by adamb10
I only see a use for an id field when you need to put 2 seperate fields together. For a table storing settings though, I dont know how it can be of use.
Posted: Thu Jul 27, 2006 11:15 am
by RobertGonzalez
So the settings table you posted the image of above is only housing one row of data? What do the setting control?
Posted: Thu Jul 27, 2006 11:38 am
by adamb10
Yes only 1 row. The settings include...
Guestbook title
Guestbook Logo
Table Width
Disable Posting
Disable BBCode
Disable Quick Post
Location of Quick Post
Turn off Menubar
Location of Menubar
Max comments to show per page
Links instead of images
Turn off IM Fields
Posted: Thu Jul 27, 2006 11:45 am
by jamiel
Each setting should have an id and it's own row to make your table practical.
id,setting,value
Posted: Thu Jul 27, 2006 12:08 pm
by adamb10
Wait, so the setting wont store anything?
I'm confused.