aRo`

automating your e-commerce

This little scripts create's a backup of your database and website files at once and puts them on a folder on your webhosting.
PLAIN TEXT
PHP:

function backupDB($dbhost,$dbuser,$dbpass,$dbname, $sitename){

global $savepath , $date ;

 

$date = date("dmY");

if (!file_exists("$savepath/$date")) {

mkdir("$savepath/$date", 0777);

}

$filename = "$savepath/$date/SQL$sitename-$date.sql";

 

passthru("mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname>$filename");

 

}

PLAIN TEXT
PHP:

function backupWWW($wwwdirectory,$wwwname){

global $savepath , $date ;

if (!file_exists("$savepath/$date")) {

mkdir("$savepath/$date", 0777);

}

$filename = "$savepath/$date/WWW$wwwname.tar.gz";

 

$zipline = [...]

For people like me comming from a Microsoft world(MS SQL/Access) these tools are great. I only used phpmyadmin before but it needed something to quicky join tables and alter data in the grid.
After some investigation i found 2 decent free tools:

webyog
MySQL GUI Tools

In this guide i'm going to give a detailed explanation on how u can get the domain name out of a referer URL wich is stored in mysql. The whole process will be executed on the MySQL server.
What i actually want to achieve is a MySQL function that returls me 'google' when my referer URL [...]