<?php

	session_start();
	
	$_SESSION['database']="local";
	
	if($_SESSION['database']=="local")
	  {
	     $db_host    = "localhost";
	     $db_user   = "root";
	     $db_pass   = "";
     	     $db_name   = "boutique";

	 }
	
	if($_SESSION['database']=="public")
	  {
  	     $db_host    = "sql2";
   	     $db_user   = "analogde";
 	     $db_pass   = "rainbow";
    	     //$db_type   = "mysql";
	     $db_name   = "analogde";
	 }


    	    	
     	    	$connexion = mysql_connect($db_host,$db_user,$db_pass); 
	 	mysql_select_db($db_name, $connexion);
	 	
		$dick = "chien";
	 	
	 	
$req = "INSERT INTO coco (id, marque, id_catalogue, fournisseur, modele, dispo, prix_ttc, prix_ht, stock, designation, 
tva, heure, date_calendrier, riri_chien) VALUES ('', 'sdf', '', '', '', '', '', '', '', '', '', '', '', '') ";
		
		
  	        mysql_query($req);	
  	        
  	        // Requête SQL base de données
		$sql	= "SELECT * FROM dev";
		$result = mysql_query($sql);

$total		= mysql_num_rows($result);
$colonnes	= mysql_num_fields($result);

echo $total;
echo "<br>";
echo $colonnes;

echo "<table width=100% cellpadding=5 cellspacing=0 border=1 class=text>\n";
echo "<tr>\n";

	for($i=0;$i<$colonnes;$i++)
	{
		echo "<th>".mysql_field_name($result,$i)."</th>\n";
	}

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

while($row = mysql_fetch_assoc($result)){
echo "<tr>\n";
	for($i=0;$i<$colonnes;$i++){
		echo "<td>".$row[mysql_field_name($result,$i)]."</td>\n";
	}
	echo "</tr>\n";
}*/
echo "</table>\n";

mysql_close();



 
	 
?>	 