Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.