je souhaiterai récupérer des données dans un tableau. Mais je n'arrive pas à truver la bonne syntaxe
<?php
$id = 10;
try
{
$db = new PDO("mysql:host=localhost;dbname=test", "root", "");
$sql = 'SELECT `JAction` , `JDate` , `JHeure` , `JInfo`
FROM `journaltest`
WHERE `JAction` like "Description :%"
ORDER BY `journaltest`.`JDate` ASC';
$statement = $db->prepare($sql);
$statement->execute(array(":JAction");
if($rows = $statement->fetchAll())
{
foreach($rows as $row)
{
echo "field: ".$row["field"]."<br />";
}
}
$db = NULL;
}
catch (PDOException $exception)
{
die("Erreur : " . $exception->getMessage() . "<br/>");
}
?>