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