title: changing background color with php
body: <p>I have problem with the changing background color of php page.
  Firstly, I want to take the color name from DATABASE to make the current color constant. I mean, if user change the background color to BLUE, for example, it will be constant and perminant. So, I store the colors in database BUT the problem is that I can't UPDATE the database according to the COLOR that user chooses. </p>
  
  <p>THIS IS THE CURRENT COLOR FROM DATABASE <strong>(THIS PART WORKS WELL, I JUST ADDED THIS PART FOR EVERYTHING TO BE UNDERSTOOD EASILY)</strong>;</p>
  
  <pre><code>&lt;body name="body" id="body" bgcolor="
  
  &lt;?php 
           mysql_connect("localhost","DB","password") or die("ERROR!!");
           mysql_select_db("DB") or die("COULDN'T FIND IT!!") or die("COULDN'T FIND DB"); 
  
  
          $sql = mysql_query("SELECT color FROM background");
  
          $color = 'color';   
  
          while($rows = mysql_fetch_assoc($sql))
          echo $rows[color];
  
  ?&gt;
  
  "&gt;
  </code></pre>
  
  <p>AND THIS IS THE PART THAT I UPDATE THE DATABASE ;</p>
  
  <pre><code>&lt;?php
  
          $con = mysql_connect("localhost","DB","password") or die("ERROR!!");
          mysql_select_db("DB") or die("COULDN'T FIND IT!!") or die("COULDN'T FIND DB"); 
  
  
              if (isset( $_SESSION['CurrentUser'])){
  
              echo '&lt;form method="post"&gt;&lt;center&gt;&lt;input type="submit" name="background" value="Change background"&gt;';
              echo '&lt;input type="submit" name="color" value="Change font color"&gt;';
              echo '&lt;input type="submit" name="size" value="Change font size"&gt;&lt;/center&gt;&lt;/form&gt;&lt;br/&gt;'; 
  
                  if (isset( $_POST['background'])){ 
  
                  echo '&lt;span style="color:black"&gt;&lt;center&gt;Choose background color&lt;/center&gt;&lt;/span&gt;&lt;br/&gt;';
                  echo '&lt;center&gt;&lt;a href="?colour=blue"&gt;&lt;img src="blue.png" width="20" height="50"&gt;&lt;/a&gt;&lt;/center&gt;'; 
                  echo '&lt;center&gt;&lt;a href="?colour=black"&gt;&lt;img src="black.jpg" width="20" height="50"&gt;&lt;/a&gt;&lt;/center&gt;'; 
                  echo '&lt;center&gt;&lt;a href="?colour=silver"&gt;&lt;img src="silver.jpg" width="20" height="50"&gt;&lt;/a&gt;&lt;/center&gt;';
                  echo '&lt;center&gt;&lt;a href="?colour=red"&gt;&lt;img src="red.png" width="20" height="50"&gt;&lt;/a&gt;&lt;/center&gt;&lt;br/&gt;&lt;br/&gt;';
  
                  $Color = $_POST['colour'];  // THIS LINE IS THE PROBLEM
  
                  if ($Color == 'blue'){
                  $sql = "UPDATE background SET color='blue' WHERE id=1";
                  mysql_query($sql,$con); }
                  if ($Color == 'black'){
                  $sql = "UPDATE background SET color='black' WHERE id=1";
                  mysql_query($sql,$con); }
                  if ($Color == 'silver'){
                  $sql = "UPDATE background SET color='silver' WHERE id=1";
                  mysql_query($sql,$con); }
                  if ($Color == 'red'){
                  $sql = "UPDATE background SET color='red' WHERE id=1";
                  mysql_query($sql,$con); }
                  }
  
      }
      ?&gt;
  
      &lt;/form&gt;
  
  
      &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>THING IS THAT EVERYTHING WORKS WELL!! I MEAN I CAN UPDATE THE DATABASE IF I WANT SO THERE IS NO <strong>PROBLEM WITH THE MYSQL CONNECTION OR SOMETHING ABOUT IT. PROBLEM IS I CAN'T GET VALUE OF "COLOR" PARAMETER TO UPDATE THE DATABASE ACCORDING TO IT.</strong></p>
  
  <p>THANKS</p>