Display values from db without require login in php
<p>I need to display the content created by the user from db even when a user is not logged in.</p>

<pre><code>&lt;? php

$get_user_content = mysqli_query($conn, "SELECT * FROM content WHERE UserName = '$username'") or die($dataaccess_error);

if(mysqli_num_rows($get_user_content) == 1 )
{
  $row = mysqli_fetch_array($get_user_content);

  $title = $row['utitle'];
  $content = $row['ucontent'];
}

echo $title;
echo $content;

?&gt;
</code></pre>

<p>But I am getting two errors:</p>

<pre><code>undefined variable: username
</code></pre>

<p>and</p>

<pre><code>Warning: mysqli_query() expects parameter 1 to be mysqli
</code></pre>

<p>I am new to PHP coding. Please help me on this.</p>
