title: Retrieve mysql value from php for radio buttons
body: <p>As trivial as it can seems, I'm having problems retrieving values for radio buttons from MySql database through PHP. It's my first learning project so I'm trying my best</p>
  
  <p>Question has already been asked but I found no useful answer.</p>
  
  <p>The php code does a simple "Select *" so I retrieve all the fields.</p>
  
  <p>This is the php code</p>
  
  <pre><code>&lt;label&gt;Owner: &lt;?php echo $row['Owner']; ?&gt;&lt;/label&gt;&lt;/br&gt;
  &lt;input type="radio" name="Owner" checked=&lt;?php if($row['Owner'] = "A") { echo "true"; }?&gt;  value="A"&gt;A
  &lt;input type="radio" name="Owner" checked=&lt;?php if($row['Owner'] = "B") { echo "true"; }?&gt; value="B"&gt;B&lt;/br&gt;&lt;/br&gt;
  </code></pre>
  
  <p>and I retrieve the values with mysqli_fetch_array().</p>
  
  <p>This is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/DIKrX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DIKrX.png" alt="enter image description here"></a></p>
  
  <p>As you can see the label retrieves the correct value, the radio buttons not.</p>
  
  <p>I've already tried putting == instead of = and putting ' instead of " but I don't know why the checkbox "B" is checked, since Owner value is A.</p>
  
  <p>Also, if there are any best practices which are better than this, you're welcome.</p>