Jump to content

Last Update Time


JohnOP

Recommended Posts

I am making a system where users can collect 5 gifts a day and send them to users.

 

i have a table

 

id - username - gift - date - quantity

 

When a user joins the site a row is inserted for them for every gift and when they get new gifts i increment the quantity.

 

I only want users to get 5 gifts per day so how would i know if there row was updated 5 times in that day?

 

Before this i had two tables, one for recording there gifts quanitity and one for recording everytime they get a gift so i can match the dates and limit them to 5 but that wasnt working well when it came to sending them.

 

Link to comment
https://forums.phpfreaks.com/topic/243530-last-update-time/
Share on other sites

I was doing that but i use images for the gifts.

 

I was querying the table that records the gifts everytime a user gets one, then retrieving the gift name so i can show the correct images but if a user got 2 roses it would insert 2 rows for roses and when showing the images to send it would show 2 roses rather than just one (but the user has 2).

 

Which is why i tried it this way that it doesn't matter how many they have it will only show one image with there quantity, if you get me lol.

Link to comment
https://forums.phpfreaks.com/topic/243530-last-update-time/#findComment-1250485
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.