Hello all i try to select stuff from the database and when i will return it so i can echo stuff out like
$instance->titel $instance->content
and like that, hope you understand, now i only got the id "1" echo out.
here is my code
<?php
/**
* Simon testClass
*/
class testClass
{
public $mysqli;
public function __construct()
{
$this->mysqli = new mysqli("localhost", "root", "root", "oop") or die("Der skete en fejl med database connection");
if(mysqli_connect_errno())
{
echo "Der skete en fejl med database connection: " . mysqli_connect_errno();
}#Lukker if mysqli database error
}#Lukker __construct
public function select($fields, $from)
{
$stmt = $this->mysqli->prepare("SELECT $fields FROM $from") or die($mysqli->error);
#$stmt->bind_param('is', $id, $titel);
#bind_result($fields);
$stmt->execute();
$object = $stmt->fetch();
return $object;
}#Lukker if prepare statment
public function __destruct(){
$this->mysqli->close();
}
}#Lukker testClass