Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Database: When use database library, page is not visible
#7

[eluser]Lorin[/eluser]
Everything works only without database library. When database is loaded, white page come back. Any other idea?

users.php:
Code:
<?php
    class Users extends CI_Controller {
        function index() {
            
            $arr = array();
            
            $arr[] = array(
                'nick' => 'test',
                'passwd' => 'oass',
                'email' => '[email protected]',
                'active' => '0'
            );
            
            $arr[] = array(
                'nick' => 'pepa',
                'passwd' => 'feqf',
                'email' => '[email protected]',
                'active' => '1'
            );

            $data = array(
                'title' => 'Some webpage title',
                'header' => 'User list',
                'query' => $arr,
            );

            //$data['query'] = $this->db->get('users');
            $this->load->view('users_view', $data);
        }
    }
?>

And users_view.php:
Code:
<html>
    <head>
        <title><? echo $title; ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <h1>&lt;? echo $header; ?&gt;&lt;/title&gt;
        <table>
            <tr><td>Jméno</td><td>Heslo</td><td>E-mail</td><td>Aktivován</td><td>Akce</td></tr>
            &lt;?php  foreach($query as $row) { ?&gt;
                <tr><td>&lt;? echo $row['nick']; ?&gt;</td> <td>&lt;? echo $row['passwd']; ?&gt;</td> <td>&lt;? echo $row['email']; ?&gt;</td> <td>&lt;?php if ($row['active'] == 0 ) { echo 'NE'; } else { echo 'ANO'; }?&gt;</td> <td>AKCE</td></tr>
            &lt;?php  } ?&gt;
        </table>
    &lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
[SOLVED] Database: When use database library, page is not visible - by El Forum - 08-12-2011, 09:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB