Can someone please tell me why my function is not working?
function myappsbdo($sqlquery, $tabname)
{
try
{
$pdo = new PDO("mysql:host=127.0.0.1;port=3306;dbname=myapps","root","");
}
catch (PDOException $e)
{
echo "Problème de connexion";
exit();
}
$sql = $sqlquery;
$result = $pdo->query($sql);
$tabname = $result->fetchALL(PDO::FETCH_NUM);
}
I do a var_dump of the variable I chose for my $tabname and it's an empty array. There is suppose to have my db data in it... Thanks!
EDIT: this is how I call it. myappsbdo("SELECT * FROM categorie", $tab1);