Thought it might help if i show you table and inserts:
CREATE TABLE `settings` (
`name` varchar(40) NOT NULL default '',
`content` varchar(255) NOT NULL default '',
PRIMARY KEY (`name`)
) TYPE=MyISAM;
INSERT INTO `settings` (`name`, `content`) VALUES ('headbarcolor','#FF0000');
INSERT INTO `settings` (`name`, `content`) VALUES ('headbartextcolor','#FFFFFF');
I changed the function to read this and it still doesn't work:
function getSetting($name)
{
$sql="select content from settings where name='$name'";
$res=mysql_query($sql);
while($obj=mysql_fetch_object($res))
{
return $obj->settingvalue;
}
}
And html I have tried a few different ways :
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td width="100%" height="13" bgcolor="<? getSetting("headbarcolor")?>"><font color="getSetting("headbartextcolor")">Purchase
Credits</font></td>
</tr></table>