Hi all,
For my portal im trying to do a blocks system.
I have a table called blocks and inside there are these fields;
ID
Name
Used - If set to 1 then its being used if 0 then not used
Left - If set to 1 display on left if 0 then dont
Right - If set to 1 display on right if 0 then dont
Then i have a folder called blocks inside there are the block php files.
Im just wondering how i would grab them from a database and then include them where there supposed to be?
My current system is this;
Grabbing from database;
$blockleft=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `left` = '1'"));
$blockright=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `right` = '1'"));
- $blockleft=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `left` = '1'"));
- $blockright=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `right` = '1'"));
Displaying;
include("blocks/$blockleft[name].tpl.php");
include("blocks/$blockright[name].tpl.php");
- include("blocks/$blockleft[name].tpl.php");
- include("blocks/$blockright[name].tpl.php");
It works but it only includes one, how do i get it to include all of them
Cheers! [/code]