0

EDIT - SOLUTION:

$pdo->fetchAll();

Table columns:
id
content

In this table I just add various contents and I'm using this code to select and add to array:

$pdo = $db->prepare("SELECT content FROM content_small WHERE id > 0 AND id < 15");
$pdo->execute();
$result['content'] = $pdo->fetch(PDO::FETCH_ASSOC);
if ($result['content']) {
    $content['slide_title'] = $result['content'][0];
    $content['who_we_are'] = $result['content'][1];
}
print_r($result['content']); //this is to test only

Right now I got results but my array print this:

Array
(
    [content] => Content test
)

The problem is that all results are from column content.

I know this isn't the best practice but its a simple thing that I'm doing.
Can you help me to find a solution?


Things I tried:
- Change fetch type

0 Answers0