define("dbserver","localhost"); // MySQL server
define("dbuser","root"); // MySQL Server Administrator Username
define("dbpass","pass"); // MySQL Server Administrator Password
define("savepath","pathtosave"); // Path to save SQL dumps
$wait = 3; // Days to save files before deletion
///////////////////////////////////////////
$dbconn = mysql_connect(dbserver,dbuser,dbpass);
$databases = mysql_list_dbs($dbconn);
while ($row = mysql_fetch_object($databases))
{
$indivualDB[] = $row->Database;
}
function mysqlbackup($host,$dbname, $uid, $pwd, $output, $structure_only)
{
if (strval($output)!="") $fptr=fopen($output,"w"); else $fptr=false;
case "timestamp":
$sql.="timestamp";
$is_numeric=true;
break;
case "date":
$sql.="date";
$is_numeric=false;
break;
case "datetime":
$sql.="datetime";
$is_numeric=false;
break;
case "time":
$sql.="time";
$is_numeric=false;
break;
default:
$sql.=$ft;
$is_numeric=true;
break;
}
if (strpos($ff,"unsigned")!=false)
{
if ($ft!="timestamp") $sql.=" unsigned";
}
if (strpos($ff,"zerofill")!=false)
{
if ($ft!="timestamp") $sql.=" zerofill";
}
if (strpos($ff,"auto_increment")!=false) $sql.=" auto_increment";
if (strpos($ff,"not_null")!=false) $sql.=" not null";
if (strpos($ff,"primary_key")!=false) $sql.=" primary key";