Welcome Guest, Not a member yet? Register   Sign In
Echoing results from a database
#21

[eluser]mdcode[/eluser]
Thank you to everyone for you comments and insight.

I think that I'm going to save what I have for future reference on how to extract single items from the database, and make a seperate config file which will be autoloaded, with items like the adminEmail and siteTitle. The intro will then be hard-coded into the page, as any future alterations would only be handled by a member of the IT team who would be "trained" in this application.

Final question on this would be how and where to reference the config items...??

Such as if the file was called config2, would I then put:
Code:
$this->config2->item('siteTitle');
in the controller where required?
#22

[eluser]TheFuzzy0ne[/eluser]
No, if you wanted to load a configuration file called config2.php, you'd have to either autoload it, or load it manually with:
Code:
$this->load->config('config2');

Then you'd access it the same way:
Code:
$this->config->item('site_title'); # etc...

Anything in the application directory is yours to edit as you see fit. Therefore, it might make more sense to put it on into the existing config.php, as it will save a disk read, and it's already loaded for you.

If you need inspiration and help, and you have time to study, check out my [url="http://ellislab.com/forums/viewthread/107773/"]CodeIgniter Resources[/url] post. There are lots or resources, tutorials and examples to get you on your way. Obviously, if you get stuck or have any questions, give us a shout.
#23

[eluser]mdcode[/eluser]
Ah, I see, thank you again -- looking over this stuff, I think I'm picking things up evne though I have only just started.
#24

[eluser]TheFuzzy0ne[/eluser]
The best way to learn is by doing. Read lots, and write your own code and understand how it works. I don't consider myself a professional Web developer. In fact most of what I know I've picked up from these forums. I am still learning also.
#25

[eluser]mdcode[/eluser]
[quote author="TheFuzzy0ne" date="1236839236"]The best way to learn is by doing. Read lots, and write your own code and understand how it works. I don't consider myself a professional Web developer. In fact most of what I know I've picked up from these forums. I am still learning also.[/quote]
Indeed... I don't consider myself to be a professional at anything, more a jack of all trades since a lot of different things seem to get put on me. Even following tutorials and things I do try to write my own code so I know what's going in there, it's slower for sure but I think its the 'correct' method as I will need to understand and adapt it to create further pages, and I think that I have read more in the last 5 days than I have since the beginning of the year.




Theme © iAndrew 2016 - Forum software by © MyBB