I am new to php/mysql. I wanted to make a little script which reads some data from the DB and prints it.
The php file looks like that:
Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: memberlist.php 8479 2008-03-29 00:22:48Z naderman $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('memberlist', 'groups'));
// Output the basic page
page_header('Medaillen');
$template->set_filenames(array(
'body' => 'medals.html')
);
$werte="SELECT Edelmetall,Name,Sportart FROM phpbb_medalwinner;";
$ergebnis = mysql_query($werte) OR die(mysql_error());
while($row = mysql_fetch_assoc($ergebnis)) {
$row['Edelmetall']." ".$row['Name']." ".$row['Sportart']."<br />";
}
$template->assign_vars(array(
'EDELMETALL' => $row['Edelmetall'],
'NAME' => $row['Name'],
'SPORTART' => $row['Sportart'],
));
page_footer();
?>
Code: Select all
<!-- INCLUDE overall_header.html -->
<h2>Medaillengewinner Peking '08</h2>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p>
<table width="1200" align="center" border="3" bordercolor="blue">
<tr>
<th width="100"><h2>Medaille</h2></th>
<th width"550"><h2>Name</h2></th>
<th width="550"><h2>Sportart</h2></th>
</tr>
<tr>
<td width="100"><h3><center>{EDELMETALL}</center></h3></td>
<td width="550"><h3><center>{NAME}</center></h3></td>
<td width="550"><h3><center>{SPORTART}</center></h3></td>
</table>
</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
I am not sure what is wrong.
I hope anyone here is able to help me solving that.
Thanks!