title: Problems with PHP if
body: <p>I can't get my PHP 'if' working as I want, this is the code I use</p>
  
  <pre><code>if ($loginselect = $mysqli-&gt;query("SELECT something FROM options WHERE type='anything'")) {
    $loginselect1 = mysqli_fetch_assoc($loginselect);
    $loginselect2 = $loginselect1['something'];
    echo $loginselect2;
  
    if ($loginselect2 = '1') {
    ?&gt;
      &lt;h1&gt;Title1&lt;/h1&gt;&lt;hr&gt;Text1
      &lt;/div&gt;
  
    &lt;?php
    }
    else {
    ?&gt;
      &lt;h1&gt;Title2&lt;/h1&gt;&lt;hr&gt;Text2
      &lt;/div&gt;
    &lt;?php
    }
  }
  </code></pre>
  
  <p>I echo the value $loginselect2 as you can see and it says 0, but it still echoes text 1 and not text 2. Is this an isue with PHP or am I doing something wrong?</p>