Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Ajout des vues & modèles
- include("vue_index.php");
- include("php/_MVC_/config.php");
- include("php/_MVC_/modele.php");
- include("php/_MVC_/session.php");
- include("php/_MVC_/dictionnary.php");
- // starts/keep the session
- session();
- //creating the page
- head(getlg($_SESSION["lang"],"title-header-index"));
- navigationbar();
- // test the database connection
- try {
- $user = 'tp_web';
- $pass = 'tp_web';
- $dbh = new PDO('pgsql:host=localhost;dbname=tp_web', $user, $pass);
- $tableRows = [];
- foreach ($dbh->query("SELECT (last_name, first_name, age) FROM users WHERE first_name='Jean';") as $row) {
- $tableRows[] = $row[0];
- }
- $dbh = null;
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
- echo "
- <div class=\"container\"></div>
- <h3>DB's results !!! \o/</h3>
- <table class=\"table table-bordered table-hover table-striped\">
- ";
- foreach ($tableRows as $row) :
- echo "<tr>";
- echo "<td>"; echo $row; echo"</td>";
- echo "</tr>";
- endforeach;
- echo "</table>
- </div>
- ";
- echo $_SESSION["lang"];
- echo $Dico["Home"];
- echo $Dico["Home"][1];
- echo $_SESSION["lang"]["Home"];
- echo ($_SESSION["lang"])["Home"];
- foot();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement