Looks to me like you use 4 columns -- just look at which array indexes are used with $row -- so you could make them the columns used in your SELECT. (Note that if those are the only 4 columns in that table, then it's not bad performance-wise to just use "*", though that makes your source code a bit less readable.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I didn't notice that before, but probably explains the OP's question: it looks like the table must have a bunch of columns with names like lvl1new, lvl1tot, lvl2new, lvl2tot, etc.... Now I'm sort of leaning toward a DB redesign to move those enumerated columns into one or more separate tables with a foreign key into the main table.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
NogDog - you are correct. There are approx 18 columns being called in each table (5 of them) out of 20 columns. The other 2 being my verification (userid and email)
It would be possible to list them all in the SELECT, but would make reading very difficult. If I am calling all but two of the columns, would that be acceptable use of the *?
I have heard of foreign keys before, but as yet have had no introduction, so do not understand them yet.
As an additional question, I am also going to have to set all the lvl1new, lvl2new etc... to 0 upon each login. Is there any way of doing this as within the original query, or do I have to run it as a separate UPDATE query? (which is what i am expecting)
Last edited by max2474; 05-20-2012 at 07:03 AM.
Reason: addition
(I've reported the post in question, so hopefully before long late-comers to this thread will wonder what you were talking about.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks