Beispiel #1
0
<?php

//INSERT
$tab_client = array('nom' => 'Rabourdin', 'prenom' => 'Baptiste');
$id_client = db_insert('clients', $tab_client, $debug);
echo 'Client inséré ' . $id_client;
//UPDATE
$tab_client = array('nom' => 'Rabourdin1', 'prenom' => 'Baptiste1');
$affected_rows = db_update('clients', $tab_client, array('id' => 1), $debug);
//DELETE
$affected_rows = db_delete('clients', array('nom' => 'Rabourdin'), $debug);
echo $affected_rows;
//SELECT
$clients = db_select('SELECT * FROM clients');
foreach ($clients as $client) {
    echo '<div>' . $client['nom'] . ' ' . $client['prenom'] . ' ' . $client['id'] . '</div>';
}
//SHOW
db_show_on_table($clients);
Beispiel #2
0
          </div>
        </div>

        <div class="row">
          <div class="large-12 columns">
            <div class="row">

              <div class="large-8 columns">
                  <h1>Accueil</h1>
                  <p class="subheader">Valorisation de pneus et câbles électriques.</p>
				  
				  <?php 
$debug = true;
include 'inc/fonctions.php';
$clients = db_select('SELECT * FROM clients');
//SHOW
db_show_on_table($clients, array('id' => 'id', 'Nom' => 'nom', 'Prénom' => 'prenom'));
?>
       
              </div>
			  
			  
              <div class="large-4 columns">
				<h2>Col Droite</h2>
			  </div>
			  
            </div>
          </div>
        </div>
<?php 
include 'blocs/footer.php';