multiple views per controller

#21
[eluser]SneakyDave[/eluser]
Quote:You shouldn’t have to downgrade. I am running the latest SVN loading multiple views “the old way.” The latest SVN has no issues with database connectivity, and surely not because of native multiple view support.

Maybe my SVN version is corrupted then, I'll try to download it again.

#22
[eluser]Craig A Rodway[/eluser]
Is it just me that doesn't have a problem with the current method then?

Controller
Code:
function index(){
  $stuff['list'] = $this->stuff_model->getStuff();

  $tpl['body'] = $this->load->view('stuff/index', $stuff, TRUE);
  $tpl['title'] = 'My Big List of Stuff';

  $this->load->view('template/main', $tpl);
}

views/template/main.php
Code:
<html>
<head>
<title><?php echo $title ?></title>
</head>
<body>

<?php $this->load->view('template/menu'); ?>

<?php echo $body; ?>

</body>
</html>

#23
[eluser]SneakyDave[/eluser]
Quote:You shouldn’t have to downgrade. I am running the latest SVN loading multiple views “the old way.” The latest SVN has no issues with database connectivity, and surely not because of native multiple view support.

I tried a new svn build, but I got the same problem. When I use the latest stable CI version, there are no database connection problems.

All I have to change in the svn version is to add the database library in autoload.php, and I change database.php to my database parameters to connect. If I remove the database library reference from autoload.php, things work (although no db connectivity of course).

I noticed 2 new database paremeters in the svn version, char_set and dbcollat, I wouldn't think they would have anything to do with the problem.

"An error was encountered" is the only thing that is displayed with "Database Error" indicated as the title.

This isn't a big deal, just curious if anybody else had run into it.

#24
[eluser]Derek Jones[/eluser]
SneakyDave, there should be a message along with the "An Error Was Encountered" box. Looks like an addition I made the lang file didn't make it into the svn. Update with the latest db_lang.php file, and I'm guessing you'll get a more detailed error revealed.

#25
[eluser]Derek Allard[/eluser]
Dave... are you replacing your database.php files with the SVN versions? If so, don't. Just add those 2 new config items. Same with your config.php... just use your old one. Does that help?

#26
[eluser]SneakyDave[/eluser]
Quote:SneakyDave, there should be a message along with the “An Error Was Encountered” box. Looks like an addition I made the lang file didn’t make it into the svn. Update with the latest db_lang.php file, and I’m guessing you’ll get a more detailed error revealed.
I got all the files from svn 30 minutes ago, wouldn't that be the correct lang file?

To try to pinpoint the problem I'm having, I've done the following...
I have the "stable version" and "svn" version installed in 2 places. All I do in both versions is add my database information to database.php, and add the database library in autoload.php.

After doing this, the svn version fails with the error I mentioned, and the stable version works fine.

I've changed the database host variable to force an connection error, and I correctly receive an "Unable to connect to your database server using the provided settings" error. So I believe the connection is being made, and my database credentials are correct.

I've replace the svn database.php and autoload.php files with the stable version's files (and added the 2 new database parameters), but that didn't help. I did a compare beforehand anyway, and noticed that nothing has changed in autoload.php, and the only difference in database.php were the two new charset parameters.

Could there be something awry or weird with the new charset functions. It doesn't look like there are a lot of changes to the MySQL drivers, only some charset functions that might be performed after connection is made.

Thanks for your time.

#27
[eluser]SneakyDave[/eluser]
ok, I see that the db_lang.php file was changed, this is the error:
Quote:Unable to set client connection character set: utf8

Should this value default to something else?

#28
[eluser]Derek Jones[/eluser]
Quote:I got all the files from svn 30 minutes ago, wouldn’t that be the correct lang file?

No, I committed it right when I posted.

#29
[eluser]Derek Jones[/eluser]
[quote author="SneakyDave" date="1201303815"]ok, I see that the db_lang.php file was changed, this is the error:
Quote:Unable to set client connection character set: utf8

Should this value default to something else?[/quote]

Nope, but that's the problem. What version of MySQL are you using? Or are you using a different database driver?

#30
[eluser]SneakyDave[/eluser]
I'm using the default driver, and my MySQL version is 4.0.27-max-log.

The client and server charset are set to "latin1".

Just for giggles, I tried to change the params to..
$db['default']['char_set'] = "latin1";
$db['default']['dbcollat'] = "latin1_general_ci";

but that didn't work.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.