title: how to change background colour in echo
body: <p>i am trying to apply the background color in echo using an inline style but it is not applying background color in however changes only the text color. i want to change background color in a particular part of the code </p>
  
  <pre><code>echo "&lt;p style='color:orange';background-color:red;&gt;"."record number: ".$rec_num. "&lt;/p&gt;"."&lt;br&gt;"
  </code></pre>
  
  <p>program code is</p>
  
  <pre><code>    class db_access
      {
      private $_uname;
      private $_pass;
      private $_db;
      private $_server;
  
      //_construct connects databaseand fetchest he result
          public function __construct($server,$user_name,$password,$d_b)
          {
          $this-&gt;_server=$server;
          $this-&gt;_pass=$password;
          $this-&gt;_uname=$user_name;
          $this-&gt;_db=$d_b;
          $con=mysql_connect($this-&gt;_server,$this-&gt;_uname,$this-&gt;_pass);
  
          $db_found=mysql_select_db($this-&gt;_db,$con);
          if($db_found)
              {
  
              $sql="SELECT * FROM login";
              $result = mysql_query($sql);
                  if ($result)
                  {
                      while ( $db_field = mysql_fetch_assoc($result) ) 
                      {
                      static $rec_num=1;
  //inline css
                      echo "&lt;p style='color:orange';background-color:red;&gt;"."record number: ".$rec_num. "&lt;/p&gt;"."&lt;br&gt;";
                      print $db_field['ID'] . "&lt;BR&gt;";
                      print $db_field['u_name'] . "&lt;BR&gt;";
                      print $db_field['pass'] . "&lt;BR&gt;";
                      print $db_field['email'] . "&lt;BR&gt;&lt;br&gt;&lt;br&gt;";
                      $rec_num++;
                      }
                      //returns the connection name that is used as a resource id in __destruct function
                      return $this-&gt;_con=$con;        
              }
                  else {die(mysql_error());}
  
              }
  
          else 
          {return die(mysql_error());}
          } 
  
  
          // destruct function closes database    
          public function __destruct()
          {
  
          $close=mysql_close($this-&gt;_con);
          if($close)
          {print "connection closed";}
          else {die(mysql_error());}
          }   
  
      }
      $db=new db_access("127.0.0.1","root","","fabeeno");
  
      //var_dump($db);
  </code></pre>