You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.8 KiB
46 lines
1.8 KiB
<?php
|
|
if(!function_exists('_tableau')){
|
|
function filter(&$value) {
|
|
$value = htmlspecialchars_decode($value);
|
|
}
|
|
function _tableau($form, $filtre = ''){
|
|
$db1 =[];
|
|
if(ENVIRONMENT == 'production'){
|
|
//evenements-abonnes.lemonde.fr
|
|
$db1['default']['hostname'] = 'localhost';
|
|
$db1['default']['username'] = 'masterclass';
|
|
$db1['default']['password'] = 'GYTeMJGx81blUGM';
|
|
$db1['default']['database'] = 'masterclass';
|
|
}else if(ENVIRONMENT == 'testing'){
|
|
$db1['default']['hostname'] = 'localhost';
|
|
$db1['default']['username'] = 'root';
|
|
$db1['default']['password'] = 'cforMada4!';
|
|
$db1['default']['database'] = 'stephane_universite1';
|
|
|
|
}else if(ENVIRONMENT == 'development'){
|
|
$db1['default']['hostname'] = 'localhost';
|
|
$db1['default']['username'] = 'root';
|
|
$db1['default']['password'] = 'cforMada4!';
|
|
$db1['default']['database'] = 'stephane_universite1';
|
|
}else{
|
|
$db1['default']['hostname'] = 'localhost';
|
|
$db1['default']['username'] = 'root';
|
|
$db1['default']['password'] = 'cforMada4!';
|
|
$db1['default']['database'] = 'stephane_universite1';
|
|
}
|
|
|
|
$con = mysqli_connect($db1['default']['hostname'],$db1['default']['username'],$db1['default']['password'],$db1['default']['database']);
|
|
if (mysqli_connect_errno()) {
|
|
echo "Failed to connect to MySQL: others ato" . mysqli_connect_error();
|
|
exit();
|
|
}
|
|
mysqli_set_charset ( $con , "utf8" );
|
|
$sql = "SELECT *$filtre FROM $form";
|
|
$result = mysqli_query($con, $sql);
|
|
$resultat = mysqli_fetch_all($result, MYSQLI_ASSOC);
|
|
mysqli_free_result($result);
|
|
array_walk_recursive($resultat, "filter");
|
|
return $resultat;
|
|
}
|
|
}
|
|
?>
|
|
|