Regarde ce script et pompe dessus si tu veut
<?php
function mysql_structure() {
$host = 'localhost';
$user = 'root';
$pass = '';
$base = 'test2';
mysql_connect($host, $user, $pass);
mysql_select_db($base);
$tables = mysql_list_tables($base);
while ($donnees = mysql_fetch_array($tables))
{
$table = $donnees[0];
$res = mysql_query("SHOW CREATE TABLE $table");
if ($res)
{
$insertions = "";
$tableau = mysql_fetch_array($res);
$tableau[1] .= ";";
$dumpsql[] = str_replace("\n", "", $tableau[1]);
$req_table = mysql_query("SELECT * FROM $table");
$nbr_champs = mysql_num_fields($req_table);
while ($ligne = mysql_fetch_array($req_table))
{
$insertions .= "INSERT INTO $table VALUES(";
for ($i=0; $i<=$nbr_champs-1; $i++)
{
$insertions .= "'" . mysql_real_escape_string($ligne[$i]) . "', ";
}
$insertions = substr($insertions, 0, -2);
$insertions .= ");\n";
}
if ($insertions != "")
{
$dumpsql[] = $insertions;
}
}
}
return implode("\r", $dumpsql);
}
echo "Taille du fichier : " . file_put_contents("sqldump-".$base."-".date("Ymd-His").".sql", mysql_structure());
?>
What's tiny, and yellow and very very dangerous?????
A canary with the super-user password.
Mouhahahaha