Welcome Guest, Not a member yet? Register   Sign In
  Updating the same Table twice, even thought it should not
Posted by: El Forum - 02-03-2008, 02:16 PM - Replies (1)

[eluser]No0oB[/eluser]
I have been having a weird problem recently.
I have a function, which shall remove old entries from a database table (where saved timestamp is smaller than current timestamp)

Code:
function clearRecruitingQueue()
{
    $this->CI->db->select('`city_id`')->from(TBL_QUEUE_WORKER)->where('`worker_endStamp` <', time());
    $query = $this->CI->db->get();
    foreach ($query->result() as $row)
    {
        $this->CI->db->query('UPDATE '.TBL_CITY.' SET `city_worker` = `city_worker` + 1 WHERE `city_id` = '.$this->CI->db->escape($row->city_id));
        $this->CI->db->delete(TBL_QUEUE_WORKER, array('`city_id`', $row->city_id));
    }
}

However, when there is more than 1 item, it always updates one each time, the loop is run.
When I echo the city_id, it shows different IDs..

What is my mistake?
The queries do change, yet, it updates only one entry

Thanks in advance


  CodeIgniter Newsletter anyone?
Posted by: El Forum - 02-03-2008, 12:25 PM - Replies (3)

[eluser]Majd Taby[/eluser]
I think it would be awsome if we had a monthly CodeIgniter newsletter which talks about new features, new events, new libraries/plugins/modules maybe interviews with prominent Forum members, website highlights....

what do you guys think?


  Missing email helper
Posted by: El Forum - 02-03-2008, 12:24 PM - Replies (2)

[eluser]Unknown[/eluser]
I'm using CI 1.5.4 and I wanted to use the valid_email from the email helper but it seems the file is missing in the bundle?

I'd also like to point out that the 1.6.0 package itself contains some "error" - every file has a duplicate filename (without ext.) in the package. Unpacking it (standard unzip tool in Vista) gives errors for duplicate names.

I solved my issue from above by using the email helper class from the 1.6.0 package in my current setup.


  Multi Upload with CI & swfUpload
Posted by: El Forum - 02-03-2008, 11:47 AM - Replies (20)

[eluser]TDSPower[/eluser]
Hye,

I need to install swfUpload which permit to upload some files instantanately.

I want to do as this exemple.

First I have installed swfUpload as noticed on the wiki.

So, on my system/javascript folder I have two files : swfupload_f9.swf && swfupload.js.

On my controller I have :

Code:
function upload(){
            $this->upload->do_upload('Filedata');        
        }
            
        function do_upload()
        {
            $config['upload_path'] = './uploads/';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['max_size']    = '100';
            $config['max_width']  = '1024';
            $config['max_height']  = '768';
            
            $this->load->library('upload', $config);
        
            if ( ! $this->upload->do_upload())
            {
                $error = array('error' => $this->upload->display_errors());
                
                $this->load->view('upload_form', $error);
            }    
            else
            {
                $data = array('upload_data' => $this->upload->data());
                
                $this->load->view('upload_success', $data);
            }
        }

I have the folder "uploads" in Controller/uploads

My view is :
Code:
&lt;head&gt;
    
    

    
        var swfu;
        window.onload = function () {
            swfu = new SWFUpload({
                // Backend Settings
                upload_url: "http://localhost/magnet/index.php/upload/doUpload",    // Relative to the SWF file
                post_params: {"PHPSESSID": "cf7mgr76aqh4j9ndgue9nd7kc4"},

                // File Upload Settings
                file_size_limit : "2048",    // 2MB
                file_types : "*.jpg",
                file_types_description : "JPG Images",
                file_upload_limit : "0",

                // Event Handler Settings - these functions as defined in Handlers.js
                //  The handlers are not part of SWFUpload but are part of my website and control how
                //  my website reacts to the SWFUpload events.
                file_queue_error_handler : fileQueueError,
                file_dialog_complete_handler : fileDialogComplete,
                upload_progress_handler : uploadProgress,
                upload_error_handler : uploadError,
                upload_success_handler : uploadSuccess,
                upload_complete_handler : uploadComplete,

                // Flash Settings
                flash_url : "&lt;?=base_url()?&gt;system/javascript/swfupload_f9.swf",    // Relative to this file

                custom_settings : {
                    upload_target : "divFileProgressContainer"
                },
                
                // Debug Settings
                debug: false
            });
        }
    

&lt;/head&gt;
&lt;body&gt;
    <div style="margin: 0px 10px;">
            &lt;form&gt;
                &lt;button id="btnBrowse" type="button" style="padding: 5px;" onclick="swfu.selectFiles(); this.blur();"&gt;<img src="images/page_white_add.png" style="padding-right: 3px; vertical-align: bottom;">Select Images <span style="font-size: 7pt;">(2 MB Max)</span></button>

            &lt;/form&gt;
        </div>
        <div id="divFileProgressContainer" style="height: 75px;"></div>
        <div id="thumbnails"></div>
    </div>
&lt;/body&gt;

Nothing is uploaded when I select an image... and no error are showed.

Thanks for your help,

François


  CI 1.6 >> Error when trying to decode using Encrypt library in PHP4.4.7
Posted by: El Forum - 02-03-2008, 11:17 AM - Replies (4)

[eluser]stevepaperjam[/eluser]
Putting my rubbish track record in bug reporting to one side for a moment, I've had a error in CI 1.6 (rev.941) in the Encrypt library.

I'm getting the error Call to a member function on a non-object in (...)libraries/Encrypt.php in my logs under PHP4.4.7 when trying to decode a string.

If I flip to PHP5.2.3 all's well.

I made the following change to Encrypt.php's decode function (line 142 onwards):

Code:
$key = $this->get_key($key);
$this->CI =& get_instance(); // new line here
$this->CI->load->library('validation');

...and this worked for me, but it might not be getting at the root of the problem. Can any PHP4ers out there confirm this bug and fix?


  Session destroy when closing browser
Posted by: El Forum - 02-03-2008, 09:36 AM - No Replies

[eluser]Armorfist[/eluser]
Is it possible for the CI_Session to have the same behavior as the native php sessions so that it gets destroyed (user logs off) when closing the browser?

Thanks


  Userauth has problem with collation?
Posted by: El Forum - 02-03-2008, 08:29 AM - Replies (8)

[eluser]Dave Nuttall[/eluser]
I wanted to take a good look at the "userauth" package, but have run into an error that probably just takes a small tweak, but as a new CI user, it's not clear where to make an adjustment.

The environment is Windows/XP with Apache2.2, MySql 5.x and PHP5.

The userauth package works perfectly on CI 1.5.4.

If I attempt to duplicate with CI 1.6, I get these four errors:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 198

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$dbcollat
Filename: database/DB_driver.php
Line Number: 198

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 200

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 204
- - - - -
Looking at the code in DB_driver.php, it looks like CI-1.6 doesn't get the character set from the database?

The database uses the InnoDB engine and the default collation is latin1_swedish_ci.

Thanks to anyone who understands all the pieces enough to prescribe a "fix"!!!


  maximum field lengths
Posted by: El Forum - 02-03-2008, 08:02 AM - Replies (1)

[eluser]Unknown[/eluser]
I wish to grab the maximum _allowable_ field length for a mysql field.
NOT the value returned by field meta data which only returns the length of the values in the field.
The value would normally be returned by msyql_field_len that provides the maximum allowable length as described by the database schema.
the value returned by field meta data with CI is just a string length of the longest value in that column.

Is this possible with CI?

Kind regards
Kevin


  SEF URLs and database
Posted by: El Forum - 02-03-2008, 07:45 AM - Replies (1)

[eluser]Unknown[/eluser]
I have a database with many products.
Using routing I was able to get SEF URLs like 'http://site.com/view/saw'.

My problem is that product names are not unique ... so I must specify the id in the URL.

What is the best way to do it:

1. something like 'http://site.com/view/saw-1234' and then parse the id from the name?
2. put id in it's own segment 'http://site.com/view/1234/saw' and then check id and name?


  CI-based Web Sites Performance
Posted by: El Forum - 02-03-2008, 07:15 AM - Replies (42)

[eluser]Edemilson Lima[/eluser]
I would like to know from the people here, that already have one or more web sites made with CodeIgniter, about its performance.

- Is your web site small, medium or big? How 'heavy' you think it is?
- How fast is it? How much time it takes to load the front page? How much time it takes to load when you click a link?
- How many simultaneous users your web site can tolerate?
- Is your hosting shared or dedicated? If shared, have it limitations? If dedicated, which is your server's configuration (CPU, memory, hard disk, etc)?
- How much server's memory is your application using for all simultaneous requests?
- Are you using CI cache?
- Are you using any PHP cache like XCache, eAccelerator or APC?
- Are you using sessions? Which kind of session are you using: cookie, PHP native or database?
- Does your web site builds all the pages from a database or is mostly static content?
- Are you using Active Record or raw queries?
- Are you using a template parser or only pure PHP code?
- Is there something special you did to get more performance when your web site access hit the sky?
- Do you think CI gives you more performance than the old way you made your applications? Why?
- What do you think about your CI-based web site running in a cluster configuration? Will it work fine?
- Is there something more you would like to say about the framework performance?
- Do you know something faster or lighter than CodeIgniter?

Well, I know this is a lot of questions...
Please answer only the ones that apply to you, you know the answer or you want to.
Your comments will be very valuable!


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

Username
  

Password
  





Latest Threads
Codeigniter Shield Bannin...
by kenjis
3 hours ago
SQL server connection not...
by kenjis
4 hours ago
Best way to create micros...
by kenjis
6 hours ago
How to use Codeigniter wi...
by kenjis
6 hours ago
Getting supportedLocales ...
by kcs
Today, 09:30 AM
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,252
» Latest member: Webnoxtechnologies
» Forum threads: 77,577
» Forum posts: 375,977

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB