2015-03-21, 02:29 PM
Hi, I am working on a site in which I will be displaying a page with multiple returned rows from the DB. I will boviously need to loop through them and display them. I'm not THAT great of a PHP developer so I need a bit of direction with doing this. Here is my code currently. I haven't gotten the DB part done yet so I'm trying to loop through an array.
I'm kind of stumped now. Lol.
Update: This is what I've got now, still not displaying the results from the database.
<?php
define('IN_MYBB', 1);
require_once("global.php");
$tests = array(
1 => "This is test #1.",
2 => "This is test #2."
);
foreach($tests as $test) {
}
eval("\$page = \"".$templates->get("Themes")."\";");
output_page($page);
?>
I'm kind of stumped now. Lol.
Update: This is what I've got now, still not displaying the results from the database.
<?php
define('IN_MYBB', 1);
require_once("global.php");
require_once("add.config.php");
$stmt = $conn->query('SELECT * FROM themes');
while($themes = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tcache[$themes['themename']] = $themes;
}
if($themes) {
eval("\$themes = \"".$templates->get("themes_theme")."\";");
}
eval("\$page = \"".$templates->get("Themes")."\";");
output_page($page);
?>