title: Getting the value from MySQL to check radio buttons generates a notice
body: <p>I'm trying to set the "checked" status of a radio button based on the value from the MySQL database. The main purpose of the code is to be a "edit user profile data" script. I managed to get all information from the database and everything gets edited as it should if the user choses to but I can't seem to make the radio buttons work. I get the following message: </p>
  
  <p>Notice: Use of undefined constant Male - assumed 'Male' in C:\xampp\htdocs\Signup\user_panel.php on line 57</p>
  
  <p>I checked SO for this notice but I couldn't find anything related to radio buttons AND the notice.</p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;form action="includes/user_panel.php" method="POST"&gt;
                  &lt;table&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;label for="email"&gt; E-mail &lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="email" name="email" id="email" value="&lt;?php echo "{$fetch['email']}"; ?&gt;"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;label for="first_name"&gt; First name &lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="text" name="first_name" id="first_name" value="&lt;?php echo "{$fetch['first_name']}"; ?&gt;"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;label for="last_name"&gt; Last name &lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="text" name="last_name" id="last_name" value="&lt;?php echo "{$fetch['last_name']}"; ?&gt;"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;label for="birthday"&gt; Birthday &lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="date" name="birthday" id="birthday" value="&lt;?php echo "{$fetch['birthday']}"; ?&gt;"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;label for="sex"&gt; Sex &lt;/label&gt;&lt;/td&gt;
                          &lt;?php
                          if ($fetch['sex'] = male)
                          {
                              echo "&lt;td&gt;&lt;input type='radio' name='sex' value='male' id='sex' checked&gt; Male &lt;input type='radio' name='sex' value='female' id='sex'&gt; Female &lt;/td&gt;";
                          }
                          else
                          {
                              echo "&lt;td&gt;&lt;input type='radio' name='sex' value='male' id='sex'&gt; Male &lt;input type='radio' name='sex' value='female' id='sex' checked&gt; Female &lt;/td&gt;";
                          }
                          ?&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/br&gt;
                  &lt;input type="submit" name="edit_user" value="Edit" class="button_1"&gt;
                  &lt;input type="hidden" name="edit_user_data"&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>Additional information:</p>
  
  <pre><code>$initial_email = $_SESSION['email'];
  $username = $_SESSION['username'];
  $query_user_panel="SELECT * FROM users WHERE email = '$initial_email' OR username= '$username'";
  $result_user_panel=mysql_query($query_user_panel) or die (mysql_error());
  $fetch = mysql_fetch_assoc($result_user_panel)
  </code></pre>
  
  <p>Line 57 is the one with the "if".</p>
  
  <p>Scroll down the code and you'll see where the sex should get checked. I tried with a "if" but that generates me the notice that I wrote.</p>
  
  <p>I know that MySQL is depreciated and I should use MySQLi. If you have the time please check this question as well: <a href="https://stackoverflow.com/questions/18782831/simplest-mysql-to-mysqli-transition">Simplest MySQL to MySQLi transition</a></p>
  
  <p>Thank you very much and please let me know if I need to edit my post or provide with additional data. </p>