Welcome Guest, Not a member yet? Register   Sign In
  DB errors
Posted by: El Forum - 11-13-2008, 04:43 PM - Replies (1)

[eluser]newsun[/eluser]
Ok so I have some code in place and error_reporting is set to 0, yet I had a DB error pop up on screen. Is there something else which controls these apart from normal error_reporting?


  Form_Validation : Not checking empty fields...
Posted by: El Forum - 11-13-2008, 04:23 PM - Replies (3)

[eluser]simshaun[/eluser]
I have two pages:
Add User
-Username (required)
-Password (required)
-Confirm Password (required) (must match password)

Edit User
-Username
-Password (optional - system doesnt update password unless something is typed here)
-Confirm Password (must match password)

The problem is with the Edit User page.
confirm_password has this rule: matches[password].

If I enter both a password and a confirmation_password, but they don't match.. it works fine and gives me an error.

However, if I enter a password but don't enter a confirmation_password, it does NOT work.
Basically it's not applying the matches[password] rule because the field is empty.

My "dirty" solution was to prepend a 'required' rule to confirmation_password if password isn't empty. I consider it dirty because I'm using a ternary operator in the array:

Code:
$this->form_validation->set_rules('confirm_password', 'Confirm Password', (($this->input->post('password') != '') ? 'required|' : '').'matches[password]');

1. Is there a more elegant solution to fix this?
2. Is this a bug?


  Create a tag cloud (kind of)
Posted by: El Forum - 11-13-2008, 03:53 PM - Replies (11)

[eluser]iDenta[/eluser]
Hello,

I'm trying to create something would look like a tag cloud, but i am not sure how to build it, since the table and so on structure is a little bit different then what you would use with FreeTag and such.

I have a table that contains a column with about 800 lines, and each line consist of a word. Now i wan't to count have many times each word occurs
in that column, and then present the results as a tag cloud. So that the most used word gets the biggest font, and so it goes on.

Now i'm kinda stuck, and don't really know how to do this with CI... The content of that column changes about 10 times a day, can that be a problem? Since it changes all the time, i probably have to check what words that are used, then count how many times they occur, and then try to create a tag cloud based on that...

So, does that make any sense? And if it does, any pointers on how to make it happend would be much appreciated Smile

Thanks!


  Override $this->load->view()
Posted by: El Forum - 11-13-2008, 03:29 PM - Replies (1)

[eluser]simonmaddox[/eluser]
How would one go about overriding $this->load->view()?

For example, if I wanted to rename the "views" folder to "pages"

Cheers

EDIT: Got it. That'll teach me. It's in Loader.php


  Update two joined tables
Posted by: El Forum - 11-13-2008, 02:58 PM - Replies (10)

[eluser]insub2[/eluser]
I'm having a hard time finding out how to do this.

I can get from the DB with the join and it works as expected.
But I can't update using $this->db->update($table, $insert).

This works for getting:

Code:
function get_profile()
    {

        $this->db->get($this->_prefix.'user');
        $this->db->join($this->_prefix.'user', $this->_prefix.'user.id = '.$this->_prefix.'user_profile.id');
        
        //SELECT name FROM user WHERE id = $id

        $this->db->where('user_name', 'insub2'); //I Know, I just haven't gotten to the point where this is done dynamically

        
        $query = $this->db->get($this->_table);
        
        $row = $query->row();
        
        return $row;
    }

I can't seem to find anyway to update a join or two tables in one query. Is it possible? It seems like it should be.


  Authenticate against Windows with LDAP Helper!
Posted by: El Forum - 11-13-2008, 02:30 PM - Replies (3)

[eluser]Iverson[/eluser]
Like most companies, the large corporation I work for uses Windows and AD for all of their user accounts, etc. Well when the web guys that were here before me would make internal web apps for the company, they would always set up new user database. So naturally when I got here, I said "wtf?". There's no reason to have 10 different usernames floating around, so I started authenticating against our LDAP server. Once I began doing this over and over, I decided to just make it a simple header. Check it out!

User Guide
http://www.gandylabs.com/ci.php/ldap_helper

Download
http://www.gandylabs.com/ldap-helper


  MAMP and .htaccess issues
Posted by: El Forum - 11-13-2008, 02:22 PM - Replies (3)

[eluser]jwindhorst[/eluser]
I know this has been discussed to death, but now my browser is trying to download my front controller, and I'm pulling my hair out. Here is what I have:

.htaccess:

Code:
1 AddHandler application/x-httpd-php5 .php
  2
  3 <IfModule mod_rewrite.c>
  4     RewriteEngine On
  5     RewriteBase /
  6     RewriteCond %{REQUEST_FILENAME} !-f
  7     RewriteCond %{REQUEST_FILENAME} !-d
  8     RewriteRule ^(.*)$ index.php/$1 [L]
  9 </IfModule>
10
11 <IfModule !mod_rewrite.c>
12     # If we don't have mod_rewrite installed, all 404's
13     # can be sent to index.php, and everything works as normal.
14     # Submitted by: ElliotHaughin
15    
16     ErrorDocument 404 /index.php
17 </IfModule>

config settings:
Code:
$config['base_url'] = "http://localhost/";
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";

Any help would be greatly appreciated!


  Updating an existing database record with $this->db->set()
Posted by: El Forum - 11-13-2008, 02:13 PM - Replies (1)

[eluser]Jose DueƱas[/eluser]
Hi,
I'm not sure what I'm doing wrong, It's something very imple but I don't get it working...

I want to update an existing record in my database:

Code:
UPDATE articles
SET views = views + 1
WHERE id = $id

so I'm doing:
Code:
$this->db->set('views', 'views + 1');
$this->db->where('id', $id);
$this->db->update('articles');

But I only get, the 'views' set to 0.

Thanks,
Jose


  allow ?ppid=(xxx) in url.
Posted by: El Forum - 11-13-2008, 01:44 PM - Replies (4)

[eluser]BeingDefined[/eluser]
I know I know, there has been so many topics on this but hear me out ...

I have my site redirect off to a third party site and after they finished with their processing, they redirect back to my site. The problem is that they add ?ppid=(random numbers) at the end of the url. So http://site.com/videos/video-title becomes http://site.com/videos/video-title?pidd=34324342342, which causes CI to throw a 404 error. I tried talking to them to redirect me the /this/type/of/url but they can't people other people depend on it. I know there was the "PATH_INFO" fix but that doesn't seem to work in 1.6 and I don't see anything new about that in the changelog of 1.7. I did search the forums and the only threads that came close to my issue were from 2006 and 2007. If i missed a thread, please link me to it Smile

Please note that there is routes involved.

Thanks


  How to...
Posted by: El Forum - 11-13-2008, 01:39 PM - Replies (5)

[eluser]frietkot[/eluser]
I saw this in the user guide:

Code:
$data = array(
               3  => 'http://example.com/news/article/2006/03/',
               7  => 'http://example.com/news/article/2006/07/',
               13 => 'http://example.com/news/article/2006/13/',
               26 => 'http://example.com/news/article/2006/26/'
             );

echo $this->calendar->generate(2006, 6, $data);

But it only shows you how to pass the days to the calendar, what if I want to pass a day, month and year to the calendar class.

How to do that?


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

Username
  

Password
  





Latest Threads
Codeigniter Shield Bannin...
by kenjis
53 minutes ago
SQL server connection not...
by kenjis
1 hour ago
Best way to create micros...
by kenjis
3 hours ago
How to use Codeigniter wi...
by kenjis
3 hours ago
Getting supportedLocales ...
by kcs
9 hours ago
Component help
by FlashMaster
Today, 01:41 AM
Show logo in email inbox
by WiParson
Today, 12:48 AM
CI 4.5.1 CSRF - The actio...
by jackvaughn03
Yesterday, 10:17 PM
Limiting Stack Trace Erro...
by byrallier
Yesterday, 02:21 PM
Bug with sessions CI 4.5....
by ALTITUDE_DEV
Yesterday, 01:36 PM

Forum Statistics
» Members: 85,228
» Latest member: 789club15vip
» Forum threads: 77,577
» Forum posts: 375,977

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB