Jump to content

Recommended Posts

hi everyone,

can someone please help me??

i have a school project that i have to make
the purpose is to make an bookstore with php and xhtml,
i have make the template and the sql database and some easy query's
but now i am stuck with the more complexer php and sql jobs

the problem is. an costumer must be able to make an booking on a book and then that book is then not for sale more
de booking expire after 10 days.
de sales guy has an overview with al expired bookings and can determine wich it like to erase
after a erase of a booking the book is available for sale

if someone can help me with one of this topics i would realy appreciate that
Link to comment
https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/
Share on other sites

Create a field called "date", with a UNIX timestamp containing the date when the booking was made.

Then, to find out which bookings should be expired, query for:

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * [color=green]FROM[/color] [color=orange]table[/color] [color=green]WHERE[/color] date[color=orange]<[/color]UNIX_TIMESTAMP(NOW())[color=orange]-[/color]864000 [!--sql2--][/div][!--sql3--]
[!--quoteo(post=381993:date=Jun 9 2006, 08:40 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 08:40 PM) [snapback]381993[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Create a field called "date", with a UNIX timestamp containing the date when the booking was made.

Then, to find out which bookings should be expired, query for:

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * [color=green]FROM[/color] [color=orange]table[/color] [color=green]WHERE[/color] date[color=orange]<[/color]UNIX_TIMESTAMP(NOW())[color=orange]-[/color]864000 [!--sql2--][/div][!--sql3--]
[/quote]

uhm sorry i don't get it is for what is the 864000???
[!--quoteo(post=382174:date=Jun 10 2006, 03:07 AM:name=cabothug)--][div class=\'quotetop\']QUOTE(cabothug @ Jun 10 2006, 03:07 AM) [snapback]382174[/snapback][/div][div class=\'quotemain\'][!--quotec--]
uhm sorry i don't get it is for what is the 864000???
[/quote]

its for refering to the current time
[!--quoteo(post=382237:date=Jun 10 2006, 05:08 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 10 2006, 05:08 PM) [snapback]382237[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Actually NOW() refers to the current time, 864000 just means "minus ten days":

60*60*24*10 = 864000

;)
[/quote]

oh oke thnx
how can i put an automatic date
(when a booking is made that the right date wil be written in the database )
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.