Welcome Guest, Not a member yet? Register   Sign In
  1.7 Form validation
Posted by: El Forum - 11-29-2008, 07:34 PM - Replies (5)

[eluser]nzmike[/eluser]
Hi there,

I've been building an application for a few months now a decided to upgrade to latest version of Code Igniter (1.7) to try out the new form validation class. I have everything working except for two things.

1. In the old validation class I would use something like:

Code:
$this->validation->content = $result->content;

To populate the inputs with data from the database and this doesn't seem to work with the new validation class (and yes I am changing it to $this->form_validation->content = $result->content).

2. To actually insert/update a value from the form to the database I called the model from the controller with something like:

Code:
$this->example_model->insert_content($this->validation->content)

Is this the correct way of doing it? And how do I do this in the new validation class? I've read the documentation but couldn't find answers to these questions...maybe I'm missing something.

Anyway Cheers,
Mike


  HAML in CodeIgniter
Posted by: El Forum - 11-29-2008, 07:00 PM - Replies (4)

[eluser]Teks[/eluser]
I was wondering if anyone has had any experience in integrating HAML templates in CodeIgniter - as you may be able to tell, I'm coming from the RoR world.

I know that there is a haml parser in php available publicly, but do not know how well it works, and if it can be integrated into CodeIgniter at all.

Does anyone have any experience with this?


  Active Record: how do I combine two or_like with an AND between them?
Posted by: El Forum - 11-29-2008, 05:52 PM - Replies (3)

[eluser]sparbier[/eluser]
Hi all,
I need to run a query that takes inputs from two arrays (from post data, don't know beforehand how many elements are given), and looks for the elements of these arrays in two separate fields in my database. So this is what I did:

Code:
if (isset($_POST['region'])) {
        foreach ($_POST['region'] as $r)  {
            // put the searched id between commas before searching for it in the string, in order not to e.g. find a 4 contained in 42 but only ,4,
            $searchstring = ','. $r .',';
            $this->db->or_like('regions', $searchstring);
        }
    }
    if (isset($_POST['instrument'])) {  
        foreach ($_POST['instrument'] as $i)  {
            $searchstring = ','. $i .',';
            $this->db->or_like('instruments', $searchstring);
        }
    }
The issue now is, that while I do want the LIKE statements within each of the two criteria be linked with OR, the two criteria must be linked with AND.

Is there any way to achieve this with Active Records?


  Load Flex 3 Application from CodeIgniter Web Server
Posted by: El Forum - 11-29-2008, 05:05 PM - Replies (7)

[eluser]fisad[/eluser]
Hey.

Anybody know how load a Flex 3 Application how home page in Web Server (Hosting) with CodeIgniter active


  SQL help for users and friends
Posted by: El Forum - 11-29-2008, 02:58 PM - Replies (5)

[eluser]bapobap[/eluser]
Hi there,

I was wondering if anyone can help. I have a users table, then a friends table. In the friends table, I record the users ID and the user ID of the persons friend in the friends table, the table looks like this:

Code:
id
user_id
friend_id
created

There are the different types of relationship, mutual friends (both users have added each other to the table), following (the user has friended another but the other hasn't reciprocated) and followers (users who have friended the user but haven't been friended back).

I'm looking for three succinct SQL queries to produce the results (without any PHP code to merge the data), which I believe should be possible, though it's way out of my expertise range, my brain hurts thinking about it. I would only be able to provide one variable for each query, which is the user id of the user in question. Using a JOIN, I can then find the username etc of each user.

If anyone thinks they can help, please do, though if you think you can help but don't have the time to spare I'd be willing to pay for your time.

Thanks anyone!


  Resetting active record 'group_by'
Posted by: El Forum - 11-29-2008, 11:47 AM - Replies (4)

[eluser]Daniel H[/eluser]
For a particular reason, I use a common field filtering function to run my GET and COUNT statements. To cut a long story short, one of these common filtering statements contains a GROUP BY line, which obviously doesn't work when a COUNT is performed.

So is there a way to reset the GROUP BY to nothing after it has been set?

Thanks,

Dan.


  CI' session question
Posted by: El Forum - 11-29-2008, 09:45 AM - Replies (6)

[eluser]chmod[/eluser]
If i enable the item sess_use_database,set

Code:
$config['sess_use_database']        = TRUE;

then CI will auot save user's session data in ci_session table.
If I set the customer's session data , the data will be store in this table.
Like this:
Code:
$this->session->set_userdata('islogin' => TRUE)

I can get the customer's data:
Code:
$this->session->userdata('islogin');

but in another controller:
I can't get the data,why?


  need some help with .htaccess
Posted by: El Forum - 11-29-2008, 08:07 AM - No Replies

[eluser]al404[/eluser]
i'm at the beginning with CI

i have in my root

.htaccess
index.php
appweb/
cms/
cms/.htaccess
cms/index.php
appcms/

with the .htaccess in the root i can redirect correctli and is in this way

RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(appweb|appcms|system|cms|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

with the second (cms/.htaccess)

i can redirect the first call correctly but if i try to call some controllers like:
http://cicmsbasic.my/cms/login/form/

i get
404 page

the .htaccess is like this

RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

what is incorrect?

before adding .htaccess it did work correctly

what shoul it be $config['index_page']

i tryed
$config['index_page'] = "cms/";
and
$config['index_page'] = "";

but didn't work

if i do call this way it works
http://cicmsbasic.my/cms/index.php?login/form/


  Version 2.0
Posted by: El Forum - 11-29-2008, 05:50 AM - Replies (6)

[eluser]mattalexx[/eluser]
I keep hearing about version 2.0 coming. When is it expected?


  Advice using CI Database Transactions
Posted by: El Forum - 11-29-2008, 05:05 AM - Replies (2)

[eluser]Rey Philip Regis[/eluser]
Hi guys, I need you help again. Just want your advice cause Im having a small problem on where to put my transaction whether to put in a CONTROLLER or in a MODEL or simply create a LIBRARY then do the transaction there. Sample I have a method insertUser() in my users_model class and an insertAddress() in my address_model class. So I want to do a transaction, so id one of the insert method fails, it will rollback. What do you think about that?

Good day.


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

Username
  

Password
  





Latest Threads
Update to v4.5.1, same us...
by kenjis
2 hours ago
Reading a session variabl...
by kenjis
2 hours ago
Codeigniter 4 extend core...
by Semsion
Today, 05:08 AM
v4.5.1 Bug Fix Released
by lokman
Yesterday, 02:12 PM
problem with textarea
by Nitin Arora
Yesterday, 05:07 AM
Showing pdf on browser
by aarefi
Yesterday, 04:38 AM
[4.5.1] Disabling the deb...
by keto
Yesterday, 02:43 AM
directory structure
by badger
Yesterday, 01:49 AM
Redirect with error vali...
by pippuccio76
Yesterday, 01:41 AM
Pass custom variables to ...
by InsiteFX
04-15-2024, 11:17 PM

Forum Statistics
» Members: 84,353
» Latest member: 8xbett6
» Forum threads: 77,555
» Forum posts: 375,882

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB