Jump to content

**Adding values daily PHP&SQL pls!**


TheStalker

Recommended Posts

Hi i am pretty new to both php and sql so be gental lol I am running WAMP5 server on local host.

 

I am trying to add a vaule to one of my tables on a daily basis. I have a table with CustomerID, Surname, Newspaper and AmountOwing. Every day i want to add the price of a newspaper to the amount owing. Im guessing it would have some thing to do with the datestamp ? like this i know this is prob not the right syntax but if some one could point me in the right direction that would be great!! OR if there is a better way to do this any ideas would be great as well!!

 

<?php

 

            $d_var=getdate(mktime());

 

if  $d_var[wday]= 0,1,2,3,4,5,6

 

sql=UPDATE AmountOwing VALUES+ 0.35 WHERE Newspaper='sun'

 

esle if

sql=UPDATE AmountOwing VALUES+ 0.65 WHERE Newspaper='The Times'

 

                        else if

 

 

                        etc

 

                        etc   

 

Also another of my big problems is going to be getting the code to only execute once a day. So each time the page is refreshed it wont keep doing the calculation if its already been done on that day.

 

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/90354-adding-values-daily-phpsql-pls/
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.