|
|||
|
Hi!
Another question from me. I connect to a database and get a row from the database Code:
$sql = 'SELECT commentaar, id FROM data WHERE id = 1'; // SQL commando $result = $db->fetchRow($sql); Code:
$lijst = array("a"=>$result->id, "b"=>$result->commentaar);
Code:
$this->lijst = $lijst; Code:
echo $lijst["a"]; echo $lijst["b"]; Code:
<table border="1px"> <th><h1 align="center">resultaat</h1></th> <tr> <td><?= $this->lijst["a"]; ?></td> <td><?= $this->lijst["b"]; ?></td> </tr> </table> What am I doing wrong? or can't you pass along arrays? I'm mostly likely passing it along wrongly? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|