Does any wap master know how to code automaticaly database update for evry 24 hours.. if u r not clear my point.. here is an examp e.. lets suppose dat every users pluses shud be updated (added) with 5 plusses i every 24 houres automaticaly... how to code dat... plz post here.thanx External image (may be gone)
Automaticaly Update Sql Db!
Started on the old forum in September 2007 · view the original in the archive · old links redirect here
$now = time(); $start=date("Y-m-d")." 23:00:00"; $end=date("Y-m-d")." 23:01:00";
$tstamp1=strtotime($start); $tstamp2=strtotime($end); if($now>$tstamp1 && $now<$tstamp2) {
$sql = 'UPDATE ibwf_users SET plusses = plusses +5';
mysql_query($sql);
}
23:00 to 23:01 - interval on each day - this interval must be more shortly in order to update only once. and you need to have at least one user online in this hour.
thanx dude.. in which hour at least one use need indeed in da wap? and wr to put dis code?
i dont use this site, put in the INDEX.PHP in login zone or autentification zone or main zone, dnno. and what is hour when at least one user..use your wap site.... dnno... External image (may be gone)
i dont understand, you want to add plussess in procent? and you want to add plussess only for who alredy got 10%plusses? whay in procent?
more simple is 1,2,3,4,5 plussess for each visit. who dont make visits dont have plussess.
i meant...Ex: all the users who have more than 100 plusses.... they shud be added 20 % plusses on thier credits ...
ill explain it more
lets suppose dat i hv 200 plusses i want to update my plusses with 20% plusses., finaly i shud hv 240, coz
(200*120 )/100=240
hope u understand now
plz post here hw to code it...
UPDATE ibwf_users SET plusses = plusses +40 WHERE plusses < '201'
this is for users who have 200 plusses and you want to add for each 40 in order to obtain 20% more.
UPDATE ibwf_users SET plusses = plusses +20 WHERE plusses < '101'
this is your first quiz , users who have 100 plusses and you want to add for each 20 in order to obtain 20%more
the sql end the add when plusses in database is equal or more like condition WHERE
if you want change the operator sign < into >
is ok now?
ok araa try this..
CODE$now = time(); $start=date("Y-m-d")." 23:00:00"; $end=date("Y-m-d")." 23:01:00";
$tstamp1=strtotime($start);
$tstamp2=strtotime($end);
if($now>$tstamp1 && $now<$tstamp2)
{
$sql = 'UPDATE ibwf_users SET plusses = plusses * 1.2 WHERE plusses > 100';
mysql_query($sql);
}
U can add it to index.php and at least a single user shud be there when ur server time is 23.00 Adjust time accordingly... External image (may be gone)
thank you so much pamod and blakhowk... finally i got it. External image (may be gone)
to get points for 5 chat lines you must select and count the last 5 lines by user and by chatroom name.
like SELECT COUNT(chatter) from ibwf_chat where chatter = 3 // each user have one id
if this result is equal with 5{
make the update }
there is a problem. if the automatic refresh run two time, and user count is 5 , the update in database is double...
lol pamod, the code you gave will update plusses yeah, but it will update anyones plusses if the clock hits (what ever time) you put... someone could have like 50000 plusses and they would get more if there online on the index.php at the time you put
to get points for 5 chat lines you must select and count the last 5 lines by user and by chatroom name.
like SELECT COUNT(chatter) from ibwf_chat where chatter = 3 // each user have one id
if this result is equal with 5{
make the update } there is a problem. if the automatic refresh run two time, and user count is 5 , the update in database is double...
yes that would be big problem, but is there any alternative solution? like i was thinking to do it from the chat points(posts) in profile. whenever 5 chat points increases in their profile, then add 1 plus to the user. exactly im not getting how to code it. can u help me please!
i dont understand, do you want to see where is the insert with point, what insert for each action or to make one update with condition in index, chat or else?
if you want to update you must decide what and for that you need some conditions.explain.
yes. first , see this movie http://www.2serveu.net/cpanel-tutorials/standardcron.html or see this tutorial http://www.webmasterstop.com/102.html second, you have cpanel?