Maybe I'm wrong when setting up the tables? I am using mysql and php. Downloading googleing shows how to count how many times a value appears in several rows, I want to check the value in many different columns, but in one record. (I think this is: counting the number of columns that have data for each row may be about the same thing, maybe, but I don't understand.)
I have a table with goals that I hope to work on and achieve every day. Therefore, for every day I want to note: "success" or "failure." And the insert works fine. Be that as it may, I am looking for a way to calculate the number of successes & the number of failures today to show the right kind of emoticons, which will be encouraging or sad, depending on the number of failures and the number of successes.
For instance:
ID date drinkMoreWater goToBedEarlier callADearFriend 1 2012 jan 15 fail fail fail 1 2012 jan 16 success _(still empty) success
So, if today is jan 15, the emoticon will be very sad. If today is jan 16, the emoticon will be really really hppy with the stars in this eye (at least until I achieve goal 2;))
source share