Votre campagne ici    
Nous sommes le vendredi 29 août 2008    


Accueil
Accueil





Accueil  Les scripts  MySQL  
Mise en ligne : lundi 29 mai 2006    
Par : CladX    

Voici un petit script me permettant de voir les tables/champs de mes differentes BDD. Cela me permet de travailler sur papier une fois le résultat imprimé.

<?php

// ------------------------------------------------------------------------- //
// Visualiser sa BDD.                                                        //
// ------------------------------------------------------------------------- //
// Auteur: Francois                                                          //
// Email:  gdljbox@hotmail.com                                               //
// Web:                                                                      //
// ------------------------------------------------------------------------- //

$bdd "Nom_de_la_base_de_données";
$nbTablesParLigne 4;

$mysql_link mysql_connect("localhost","root","");
mysql_select_db($bdd,$mysql_link);

$query "SHOW TABLES FROM $bdd";
$result mysql_query($query,$mysql_link);

$i=0;
echo 
"<table border=1 cellpadding=8>\n<tr>\n";

while (
$row mysql_fetch_row($result))
{
    
$i++;
    echo 
"<td width=".intval(100/$nbTablesParLigne)."% valign=\"top\">";
    echo 
"<b><center><font size=+2>$row[0]</font></center></b><br>";
    
$query "DESC $row[0]";
    
$resultTable mysql_query($query,$mysql_link);
    echo 
"<table width=100%cellpadding=5 cols=3>";
    while (
$row2 mysql_fetch_row($resultTable))
    {
        echo 
"<tr><td>$row2[0]</td><td width=10></td><td align=right>";
        echo 
"<i>$row2[1]</i></td></tr>";
    }
    echo 
"</table>";
    echo 
"<br></td>\n";
    if (
is_int($i/$nbTablesParLigne))
        echo 
"</tr>\n<tr>";
}

while (!
is_int($i/$nbTablesParLigne))
{
    echo 
"<td>&nbsp;</td>";
    
$i++;
}

echo 
"</tr>\n</table>";

?> 


--- Réagir à cet article ---




Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7339914 bytes) in /var/www/vhosts/e-outils.com/httpdocs/actu/ecrire/inc_index.php3 on line 73