dynamic stylesheet
<p>Iam trying to retrieve data from mysql database into stylesheet.php but it is not working.</p>

<p>main page:</p>

<pre><code>&lt;link rel="stylesheet" href="includes/dynamicstyle.php" media="screen"&gt;
</code></pre>

<p>stylesheet.php</p>

<pre><code>&lt;?php header("Content-type: text/css;"); ?&gt;  
&lt;?php
require 'connect.php';
$userid = $_SESSION['uid'];
$select_query = "SELECT * FROM theme where user_id = $userid";


$primaryTextColor = '#336600';
$secondaryTextColor = '#fff';
$tertiaryTextColor = '#555';
$primaryBGColor = '.$background.';
$secondaryBGColor = '#ccc';
$tertiaryBGColor = '#000';
$primaryTextSize = '10'; //pixels
?&gt;
#pro_theme{
 color: &lt;?php echo $primaryTextColor?&gt;;
 background: &lt;?php echo $primaryBGColor?&gt;;

}
#con_theme {
 background: &lt;?php echo $secondaryBGColor?&gt;;
 font-size: &lt;?php echo 1.1*$primaryTextSize ?&gt;px;
}
#des_theme{
background: &lt;?php echo $secondaryBGColor?&gt;;
 font-size: &lt;?php echo 1.1*$primaryTextSize ?&gt;px;
}
#basic{
background: &lt;?php echo $secondaryBGColor?&gt;;
}
&lt;?php 
$result_select = mysql_query($select_query)or die(mysql_error());
if ($result_select){
     $row = mysql_fetch_assoc($result_select);
     $background = $row['background'];

    }
?&gt;
</code></pre>

<p>It is not working for me, I just want to know is that a right way to do or is there anything better way of doing this.</p>

<p>thanks.</p>

<p>Edit:</p>

<p>Thanks for the advice, its working now.</p>
