Welcome Guest, Not a member yet? Register   Sign In
database connection
#1

[eluser]Crnaovca[/eluser]
I just don/t get it what I am doing wrong. This is in database file

Code:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "admin";
$db['default']['password'] = "1234567";
$db['default']['database'] = "app_man";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

so is this correct?
should I have somethin in dbprefix?

Also, in file autoload as first line I have put

Code:
$this->load->database();

and then in app I am writing I have done this

Code:
<select name="stanje_artikla" size="1" class='moj_input3'>
        &lt;?php

            $query = $this->db->get('tbl_som');

                if($query->num_rows() > 0) : // just to make sure ...

                    foreach ($query->result() as $row) :

                        ?&gt;<option value=" &lt;?php echo $row->id ?&gt;"> &lt;?php echo $row->som ?&gt;</option>&lt;?php  

                    endforeach;

                endif;

        ?&gt;
        </select>

and this just doesn't work ... it breaks, but gives me no error, just stops loading page ...
#2

[eluser]thinkigniter[/eluser]
Hi Crnaovca,

This could be a problem with the frustrating HTML editor, stripping out content, that is used for the forums.

But
Code:
&lt;?php echo $row->id ?&gt;
is missing ";".

Is this causing the problem?

Also, is there a field in your table named "id"?
#3

[eluser]John_Betong[/eluser]
Set config.php -> $config['log_threshold'] to 1.

Check the path of config.php -> $config['log_path'].

Clear or delete your log file, run your program then post your error_log file.
&nbsp;
&nbsp;
&nbsp;
&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB