cabothug Posted June 9, 2006 Share Posted June 9, 2006 hi everyone,can someone please help me??i have a school project that i have to makethe purpose is to make an bookstore with php and xhtml,i have make the template and the sql database and some easy query'sbut now i am stuck with the more complexer php and sql jobsthe problem is. an costumer must be able to make an booking on a book and then that book is then not for sale morede booking expire after 10 days.de sales guy has an overview with al expired bookings and can determine wich it like to eraseafter a erase of a booking the book is available for saleif someone can help me with one of this topics i would realy appreciate that Quote Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/ Share on other sites More sharing options...
poirot Posted June 9, 2006 Share Posted June 9, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/#findComment-43777 Share on other sites More sharing options...
cabothug Posted June 10, 2006 Author Share Posted June 10, 2006 [!--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??? Quote Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/#findComment-43954 Share on other sites More sharing options...
legohead6 Posted June 10, 2006 Share Posted June 10, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/#findComment-44012 Share on other sites More sharing options...
poirot Posted June 10, 2006 Share Posted June 10, 2006 Actually NOW() refers to the current time, 864000 just means "minus ten days":60*60*24*10 = 864000;) Quote Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/#findComment-44016 Share on other sites More sharing options...
cabothug Posted June 11, 2006 Author Share Posted June 11, 2006 [!--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 thnxhow can i put an automatic date(when a booking is made that the right date wil be written in the database ) Quote Link to comment https://forums.phpfreaks.com/topic/11597-help-with-a-school-project/#findComment-44215 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.