Display data from database PHP OOP
<p>I'm pretty new to PHP OOP and i have to make a small web app for school.</p>

<p>One of the things i'm trying to do right is to select data from the database and display it in my front-end. I figured out how to display a single row but i wanted to display all rows in the table. How can i do that?</p>

<p>My function:</p>

<pre><code>public function listJobs(){

        $myDb = $this-&gt;_controlPanel-&gt;getMyDb();
        $query = "Select * FROM jobs_offers";

        $result = $myDb-&gt;performQuery($query);


            $row = $result-&gt;fetch_array(MYSQLI_ASSOC);
            $this-&gt;title=$row['title'];
            $this-&gt;description=$row['description'];
            $this-&gt;category=$row['category'];
            $this-&gt;budget=$row['budget'];


}
</code></pre>

<p>My front-end:</p>

<pre><code>&lt;?php
header ('Content_type: text/html; charset=ISO-8859-1');

require_once ('utils/Autoloader.php');
session_start();

if (empty($myControlPanel)) {

    try {

    $myControlPanel = new classes_ControlPanel();

    $myControlPanel-&gt;setMyDb(new classes_DbManager());

    $myDbManager = $myControlPanel-&gt;getMyDb();

    }


    catch (Exception $e) {

        echo $e-&gt;getMessage();
        die();
    }
}


$log = new classes_UserManager($myControlPanel);
$select = $log-&gt;listJobs();

$title = $log-&gt;title;
$description = $log-&gt;description;
$category = $log-&gt;category;
$budget = $log-&gt;budget; 

?&gt;



&lt;body&gt;
&lt;div class="container-fluid"&gt;

&lt;h2&gt;
&lt;h2&gt;&lt;?php echo $title; ?&gt; &lt;/h2&gt;
&lt;h2&gt;&lt;?php echo $description; ?&gt; &lt;/h2&gt;
&lt;h2&gt;&lt;?php echo $category; ?&gt; &lt;/h2&gt;
&lt;h2&gt;&lt;?php echo $budget; ?&gt; &lt;/h2&gt;

&lt;/div&gt;
</code></pre>