[request] Hourly credits

jamo

New Member
Oct 23, 2010
25
0
Could someone write me php file that will do the following:

-after 1 hour, the user receives 1000 credits.
-the user does not have to be online to receive the credits
-if the user has more than 15000 credits, no credits will be added


start with this:
Code:
<?php
UPDATE users SET credits = '1000' WHERE id = '1';
?>

you can also use sleep(seconds here); for the part where it waits an hour.

thanks!
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
You should seriously learn PHP before "making a CMS", also adding features doesn't mean that the CMS is yours. Putting all those things aside, here's the code you should use.
Code:
<?php 
dbquery("UPDATE users SET credits = '1000' WHERE credits < 1000"); ?>

That's the query, you have to do other things, example, in uber you have to do after the query $core->Mus('updateCredits', 'All');

All the credits for that query goes to meth0d, do NOT claim this as your own.

Hope you learned something out of this.
 

jamo

New Member
Oct 23, 2010
25
0
Won't that just make it so you allways have atleast 1000 credits? I'd prefer to have it like in the first post description. I know a bit of php but i don't understand the mysql query.

And i'll give you credits if I use your code >.>
 

jamo

New Member
Oct 23, 2010
25
0
Ive seen this working 100% cms sided. And with your code... how would you set the time? and it looks like its setting the credits to 1000 rather than adding 1000 correct me if i'm wrong.
 

Users who are viewing this thread

Top