This question already has an answer here:
I have a question, first look my code:
$testsql = $db->prepare('SELECT * FROM forum_sujets');
$testsql->execute();
$test = $testsql->fetch();
print_r($test);
My DB:
Ok, so I want to select my information in array, and i wan't this array look like:
array(
'id' => '1', array(
'nom' => 'test',
'titre' => 'test',
'auteur' => 'test',
),
'id' => '2', array(
'nom' => 'test2',
'titre' => 'test2',
'auteur' => 'test2',
),
);
Ok, and after my array look like this, I want to echo, for exemple, the name of the ID "2", I don't known if i'm clearful. I hope you can help me, see u :)
</div>