Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

checking a date

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2963
Location: Earth

PostPosted: Sun Dec 16, 2007 12:51 pm    Post subject: checking a date Reply with quote

I'm not sure if this is more suited for PHP or for both PHP/MySQL since their both involved, but can it pleased be moved if its the wrong place

What i'm trying to do is a staff pay system where the staff member will go to a certain page and will get their items

Staff pay resets every Saturday. The member of staff can get the pay any day of the week.

When the staff member gets the pay, its entered into a database.

Code:
CREATE TABLE `staffpay` (
  `ID` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `date` date NOT NULL,
  PRIMARY KEY  (`ID`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;


Name is the staff members name and date is the date they received the pay.

What i'm looking to do is make it so that they can only gain the staff pay once a week, as at the moment they can go every day. This is where i need a push in the right direction, as i'm unsure what the best way of going about this is

This is the code i have currently

Code:
<?php
include ('games/insert.php');
$sql = mysql_query("SELECT * FROM `staffpay` WHERE `name` = '".$_COOKIE['dwtcg']['u']."'") or die(mysql_error()); $result = mysql_num_rows($sql);
if ($result != 0) {
   die("<p>Already Got staff pay this week</p></div></div></body></html>");
} else {
   echo "<br/>All thats below have been added<br />";
   normal(); normal(); normal(); normal(); normal(); special();
mysql_query("INSERT INTO `game` VALUES (NULL, 'movie', '".$_COOKIE['dwtcg']['u']."', '" . $_SESSION['id'] . "')") or die(mysql_error());
}?>


So i either need to change the sql so that it checks that i haven't recieve pay since the saturday that had just gone, or some php that does the same
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com