Welcome Guest, Not a member yet? Register   Sign In
  Test for database connection success
Posted by: El Forum - 08-01-2008, 08:57 PM - Replies (7)

[eluser]Aquillyne[/eluser]
I want to connect to my database with $this->load->database(), but I want to be able to control what happens if it fails (rather than it throwing up an error).

A try/catch block doesn't seem to work. The problem appears to be that CI has custom error handling here.


  Database driven page
Posted by: El Forum - 08-01-2008, 07:04 PM - Replies (2)

[eluser]molivetti[/eluser]
Hello everyone, i'm a noob of ci and i am trying to make the database able to create a page. In details i have this page, where i want to show our work (like portfolio/ID), but i don't know how to do this part. I have already set up the db and the portfolio tables, and also read several tutorial but i just can't understand them (i'm not a programmer Tongue)


  Dividing up public and private access between controllers
Posted by: El Forum - 08-01-2008, 06:09 PM - No Replies

[eluser]-sek[/eluser]
I have a question, but first some background.

I have a controller enabling users to browse a list of their friends in their social network. They can remove or approve friends in this list. A user must have valid credentials to login in order to see this page.

A different controller is responsible for the the display of the user profile to the public. This page displays a list of friends. Since this list can grow fairly long, I want to create a separate page listing all friends. The profile will display a limited number of friends and a link to the page showing all friends. This is pretty common.

Now, the question.

The code for displaying "more friends" can go either in the Friends controller or the Profile controller. The functions implemented by the friends controller at this time are all accessible only to logged in users. If I chose this solution, I will be mixing private and public functions in the same controller, although each with different access requirements (logged in user and public). The feature will reside at (friends/more/username.html) along with the private management function (at friends/browse.html).

If I chose the Profile controller (at profile/friends/username.html or profile/morefriends/username.html), two public functions will reside in a controller with only public function (at this time).

I suppose this breaks down into two questions: what is the best location the feature should appear at (I know an alias can be setup) and whether it is a good idea to mix controllers with public and private purposes. It seems that if I do the proper authentication for each function, that it would be okay to mix various access levels in the same controller. I'd like to have your opinion on the issue.


  passing a lot of data via uri segments
Posted by: El Forum - 08-01-2008, 04:08 PM - Replies (4)

[eluser]spherop[/eluser]
newbie to ci and still learning the ropes ...

i have some jquery/javascript code that will insert data in the db by ajax request.

in the form data are many fields including [artistname, genre, url, description] etc.

is the standard uri segment approach used in a case like this typically?

in this case the user will not see the url as it will be ajax, but i am wondering what people do when they don't want a huge ugly url from a lot of data being passed in?

what kind of encoding decoding needs to be done to prevent (using a url as example) "/"'s or other characters from messing up the uri segments?

love some guidance or pointers ...


  MySQL query help with subquery
Posted by: El Forum - 08-01-2008, 03:25 PM - Replies (8)

[eluser]jonnyjon[/eluser]
Hi,
I have three tables:
[urls] id, url
[url_tags] url_id, tag_id
[tags] tag_id

I would like to select N records from the "urls" table as well as all the tags for each url.

The way I'm doing it now is:

1. Selected the urls from the urls table
2. Loop through each url and select the tags

While this works it results in dozens of mysql statements...

Is there a better way to get the results?


  automate loading header and footer views
Posted by: El Forum - 08-01-2008, 02:55 PM - Replies (8)

[eluser]eilrahc[/eluser]
Hiya,

I'm brand-new to codeigniter and so far I'm pretty impressed. I'm setting up a toy application to start with and finally ran into something the docs don't seem to address.

It's a basic CRUD-style app and all of the pages will look roughly the same, so I thought I'd divide the views up between a header, body, and footer. In the docs for the Views, it says you can load multiple views as in:

Code:
$this->load->view('header');
$this->load->view('body');
$this->load->view('footer');

This is great but I was wondering if there's a way to have the header and footer automatically loaded so I don't have to add the header and footer lines to every controller function. The header view displays just fine on each page when loaded from the constructor, so I thought that maybe a destructor would do the same for the footer. Unfortunately, it doesn't. I suspect that by the time the destructor is called, codeigniter has wrapped up all the view stuff or something.

Is there any way (or a better way) to have both my header and footer views loaded automatically without explicitly loading them in each function?


  Routes arguments.
Posted by: El Forum - 08-01-2008, 01:23 PM - Replies (3)

[eluser]Young Caveman[/eluser]
Hi all!
First thing first you have to know that I'm a newbie with routes :-)
So this is my problem. I set this route:

Code:
$route[':any'] = "token/section/$1";
Which takes to the controller "token" and passes to the function "section" the argument "any".
This is my controller:
Code:
function section($section)
{
    stuff
}

If I go to http://mysite.some/else the result would be: http://mysite.com/token/section/else
But when I pass the variable $section through $data array, the view simply prints "$1".
Where's the mistake? :O
Thank you all in advance.

And, I apologize for my very bad English. :-)


  Sessions not working on Blackberry mobile browser
Posted by: El Forum - 08-01-2008, 01:21 PM - Replies (4)

[eluser]Jonathon Hill[/eluser]
Help!

I have a CI mobile webapp using the Michael Wale's Erkanaauth authentication library. Everything was working fine on our development server, but I just set up a production box and now I can't log in.

The user is being authenticated fine, but somehow the CI sessions library isn't working right with the Blackberry browser. I've cleared the cache and cookies but that does not help.

As I said, this was working with the Blackberry until I switched servers. The dev server was using http, the new server is using https. It works fine with desktop browsers as well.

I'm stumped. Can anyone help?

Update: I have sess_match_useragent and sess_match_ip set to false in config.php.


  Active record last insert ID
Posted by: El Forum - 08-01-2008, 01:05 PM - Replies (4)

[eluser]Unknown[/eluser]
I have a table with an auto_incrementing column that's set as the primary key. Is it possible to get the number from this column after doing an insert with active record without having to run another query? I couldn't find anything in the docs or the forums.

Thanks!
Dan


  Loading Pagination Library Results in the dreaded white screen - help
Posted by: El Forum - 08-01-2008, 11:45 AM - Replies (1)

[eluser]lefrog[/eluser]
Hi all

The title says it all. Whenever I try and load in the Pagination library I get the dreaded white screen.

All other libraries seem to be working.

Any help would be most welcome.

Cheers,
Jonny


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Error / Shield 1.0.3 + Ci...
by kenjis
1 hour ago
Integrating Bootstrap 5 i...
by tarcisiodev1
3 hours ago
Asset Minification Packag...
by tarcisiodev1
3 hours ago
Modify users data as an a...
by luckmoshy
3 hours ago
Is it possible to go back...
by ejimenezo
8 hours ago
SQL server connection not...
by davis.lasis
Today, 07:11 AM
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,496
» Latest member: fcb8ist
» Forum threads: 77,586
» Forum posts: 376,025

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB