title: How to fetch data of specific column from MySQL?
body: <p>I have a problem when I want to display name from genres table...How to call 
  this function and how to get name from genres...When I use echo I get undefined $data...</p>
  
  <pre><code>public function getGenreName(){
      $query = mysqli_query($this-&gt;con, "SELECT * FROM genres WHERE id='$this-&gt;genre'");
      $data = mysqli_fetch_array($query);
      return $data['name'];
    }
  </code></pre>