Get script mysql cubis weekly please :D
Printable View
Get script mysql cubis weekly please :D
learn english!
Sorry, Yes haha my english is bad :D
I will give you some hints:
1. Learn english
2. Learn php
3. Learn how crontab works
4. Make a shell script that use wget to retrieve the php page for your cubi script
5. Make a new line in crontab with the desired time to launch your shell script
That's all... You will need to find the rest by yourself!
Yours no know none?
Well to be nice, yeah Learn English, Learn PhP, Learn Cron, and then try it lol... Or beg me to do it for you lol your choice XD
hrace you have one script of cubi ?, no matter cultivation.
There is nothing wrong with using wget though :P
Although I spose one could argue it is the less efficient way of doing it...
zen.php
Crontab:PHP Code:<?php
$Host = "localhost" ; // localhost or your IP
$User = "root"; // Database user
$Password = "root"; // Database password
$Name = "dbo"; // Database name
$Amount = ; // how much zen you want to add *100
$Link = MySQL_Connect($Host, $User, $Password) or die ("<HTML><BODY><center><b>The server is momentarily down please try again after 5 minutes!</b></BODY></HTML>");
MySQL_Select_Db($Name, $Link) or die ("<HTML><BODY><center><b>The server is momentarily down please try again after 5 minutes!</b></BODY></HTML>");
$prepare_w = "SELECT ID FROM users ORDER BY ID ASC, ID ASC";
$execute_w = mysql_query($preparew);
$top_num =0;
while ($data = mysql_fetch_array($execute_w))
{
$top_num++;
$uweb = "call usecash ($data["ID"] , 1, 0, 1, 0, $Amount, 1, @error)";
$resu = mysql_query($uweb);
$QWE = mysql_fetch_array($resu);
}
echo "Updated $top_num Rows";
mysql_close($Link);
?>
nono /etc/crontab
add a line like this:
* * * * 6 root /usr/bin/wget http://localhost/zen.php -q > /dev/null
PHP Code:# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
#<----------------------------------------------Start--------------------------------------->
* * * * 6 root /usr/bin/wget http://localhost/zen.php -q > /dev/null
This scrip this not tested but i think it might work.
The webserver uses CGI (unless it's Apache which can handle it directly instead of over CGI) which runs the PHP script and instead of outputting to a console it gets sent by the HTTP server. Using php5-cli skips the HTTP server and instead runs it over the console, you can create fairly powerful scripts and programs using only PHP. PHP is not just a web development language even though that is what it was primarily created for.
PHP: Command line usage - Manual
You can even make GTK applications in PHP PHP-GTK
Not run