Welcome Guest, Not a member yet? Register   Sign In
  Database class odity/bug
Posted by: El Forum - 10-22-2007, 04:51 AM - No Replies

[eluser]MyBelovedPHP[/eluser]
Seems that you can't do:

Code:
$sql = "SELECT *,lpad(id,8,'0') as id2 from table ORDER BY id2 DESC";
$query = $this->db->query($sql);
foreach ($query->result() as $row){

Just a white screen, no output at all, my controller simply ends.
The Select *, lpad(id,8,'0') as id2 seems to be the problem, when looping the foreach.

If I write out all column names (no *), i don't experience a problem.

The query is proper SQL though and will run everywhere, but not in CI.
Must be a bug somewhere in $query->result() as $row
FYI: I use it in a model class.
Can anyone confirm?

Debug shows:
DEBUG - 2007-10-22 12:47:33 (mem: 274.47) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 274.16) --> Hooks Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 383.11) --> No URI present. Default controller set.
DEBUG - 2007-10-22 12:47:33 (mem: 383.20) --> Router Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 446.55) --> Output Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 601.65) --> Input Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 603.51) --> Global POST and COOKIE data sanitized
DEBUG - 2007-10-22 12:47:33 (mem: 650.05) --> URI Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 671.36) --> Language Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 930.20) --> Loader Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 1,438.46) --> Database Driver Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 1,437.66) --> Controller Class Initialized
DEBUG - 2007-10-22 12:47:33 (mem: 1,527.48) --> Helpers loaded: url
DEBUG - 2007-10-22 12:47:33 (mem: 1,635.26) --> Model Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 274.40) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 274.23) --> Hooks Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 383.11) --> No URI present. Default controller set.
DEBUG - 2007-10-22 12:47:34 (mem: 383.20) --> Router Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 446.55) --> Output Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 601.65) --> Input Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 603.51) --> Global POST and COOKIE data sanitized
DEBUG - 2007-10-22 12:47:34 (mem: 650.05) --> URI Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 671.36) --> Language Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 930.20) --> Loader Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 1,438.46) --> Database Driver Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 1,437.66) --> Controller Class Initialized
DEBUG - 2007-10-22 12:47:34 (mem: 1,527.48) --> Helpers loaded: url
DEBUG - 2007-10-22 12:47:34 (mem: 1,635.26) --> Model Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 274.40) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 274.23) --> Hooks Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 383.11) --> No URI present. Default controller set.
DEBUG - 2007-10-22 12:47:35 (mem: 383.20) --> Router Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 446.55) --> Output Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 601.65) --> Input Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 603.51) --> Global POST and COOKIE data sanitized
DEBUG - 2007-10-22 12:47:35 (mem: 650.05) --> URI Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 671.36) --> Language Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 930.20) --> Loader Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,438.46) --> Database Driver Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,437.66) --> Controller Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,527.48) --> Helpers loaded: url
DEBUG - 2007-10-22 12:47:35 (mem: 1,635.26) --> Model Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 274.41) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 274.24) --> Hooks Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 383.13) --> No URI present. Default controller set.
DEBUG - 2007-10-22 12:47:35 (mem: 383.22) --> Router Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 446.56) --> Output Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 601.66) --> Input Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 603.52) --> Global POST and COOKIE data sanitized
DEBUG - 2007-10-22 12:47:35 (mem: 650.06) --> URI Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 671.38) --> Language Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 930.22) --> Loader Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,438.48) --> Database Driver Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,437.68) --> Controller Class Initialized
DEBUG - 2007-10-22 12:47:35 (mem: 1,527.50) --> Helpers loaded: url
DEBUG - 2007-10-22 12:47:35 (mem: 1,635.27) --> Model Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 274.41) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 274.24) --> Hooks Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 383.13) --> No URI present. Default controller set.
DEBUG - 2007-10-22 12:47:36 (mem: 383.22) --> Router Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 446.56) --> Output Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 601.66) --> Input Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 603.52) --> Global POST and COOKIE data sanitized
DEBUG - 2007-10-22 12:47:36 (mem: 650.06) --> URI Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 671.38) --> Language Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 930.22) --> Loader Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 1,438.48) --> Database Driver Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 1,437.68) --> Controller Class Initialized
DEBUG - 2007-10-22 12:47:36 (mem: 1,527.50) --> Helpers loaded: url
DEBUG - 2007-10-22 12:47:36 (mem: 1,635.27) --> Model Class Initialized
DEBUG - 2007-10-22 12:47:37 (mem: 274.43) --> Config Class Initialized
DEBUG - 2007-10-22 12:47:37 (mem: 274.26) --> Hooks Class Ini


  Image upload - temp dir not found?
Posted by: El Forum - 10-22-2007, 04:12 AM - Replies (1)

[eluser]#1313[/eluser]
Hi there.

I am uploading an image to my server. Everything works smoothly, until i decide to upload a big file (2+ mb). This gives me the really weird error from image_lib, something like this:

Code:
./tmp/ not found.

This obviously happened because of my max_upload_size variable, and i fix the problem by upping this limit from 2M to 4M in my php.ini. Okay, the big file uploads.

And then after a few hours i receive this error message again, this time with tiny 1.62mb image. My code is unchanged, and other smaller pictures are uploading correctly.

So, my two questions:
1. Isn't this "temp dir not found" message somewhat vague? I have a feeling that it says "Error! Go figure out what really happened by urself, lol".
2. What the heck is actually happening, lol?


  Validation
Posted by: El Forum - 10-22-2007, 03:49 AM - Replies (11)

[eluser]schnoodles[/eluser]
Hello i am currently building a usersystem and i am up to the part where you check to see if the username and password is correct. i was wondering if there is a proper way to throw errors for functions to make them look like it was a validation error.

So i could do like

Code:
if ( $validation->run() == true ) {
if ( !$user->exists ) { //do like a validation error }
else {

}
}

Anyone know what the best way to accomplish what i am trying to do is ?


  Extract excel data using php
Posted by: El Forum - 10-22-2007, 03:05 AM - Replies (12)

[eluser]MASS MASS[/eluser]
Is it possible to extract excel(xls extension) data from php and CI....then that will stored in to our database


  Load view components in 404 error pages
Posted by: El Forum - 10-22-2007, 02:40 AM - No Replies

[eluser]Skateinmars[/eluser]
Hello, I am trying to integrate 404 pages nicely with a website.

Currently I translated the hardcoded strings in the show_404 function, and adapted the layout of the error_404.php file, but I'd like to be able to load views and helpers in this file.

Considering that I can't use the $this variable (which corresponds to the CI_Exceptions class), is there a simple way to do this ?


  [Resolved] 2 tables in one form
Posted by: El Forum - 10-22-2007, 02:32 AM - Replies (4)

[eluser]Yash[/eluser]
I want to update 2 tables using a single form.How can I do this?

like I want to distribute information in 2 tables using single form.


  Hello World
Posted by: El Forum - 10-22-2007, 02:04 AM - Replies (9)

[eluser]PHP Programmer[/eluser]
Hi Guys

I am still unable to run the first program (Hello World) in codeigniter as I don't have the directory named 'library' in my 'system' folder. How can I get it? I have downloaded the zipped files from the site so many times with different browsers (Firefox, IE), but all are in vain. Anybody can give that directory to me in anyway.

TIA
Anuj


  FCKEditor integration: security issue
Posted by: El Forum - 10-21-2007, 11:53 PM - Replies (1)

[eluser]Dionysius[/eluser]
Hi to all!
I use FCKEditor on my web-site with CI and it works on admin's page only (admin must login first to have access). Upload module is enabled.
I worry about security. It is possible to open html-pages from fckeditor directory. Can some malicious man to upload something to my server? What can I do to prevent this? How to protect upload.php by password?

Thanks


  How to call a variable globally
Posted by: El Forum - 10-21-2007, 11:02 PM - Replies (9)

[eluser]cinewbie81[/eluser]
Hi guys,

I have a file ‘globalsetting.php’ as following:

Code:
<?php

class Globalsetting extends Controller {

    function Globalsetting()
    {    
        parent::Controller();
    }

    // Initialization function  
    function Initialize()
    {
           $DB1 = $this->load->database('MYDB1', TRUE);
           $DB2 = $this->load->database('myDB2', TRUE);
           $MyClient = "DELL";            
    }
}
My problem is:

How can i call variables DB1, DB2, and MyClient from other controller class ?? Anyone ? IS that correct that I put Globalsetting class extend from controller ? Hope someone can helkp as I’m stuck here for quite a while .. thanks in advance


  Using Aptana IDE with Codeigniter
Posted by: El Forum - 10-21-2007, 04:12 PM - Replies (1)

[eluser]Unknown[/eluser]
Hello all,

I've decided to try out the Aptana IDE for developing with Codeigniter. I've noticed that Aptana was mentioned in the forums for use with CI, but was wondering if I needed to configure either Aptana or CI to work with each other.

For example, the Aptana Radrails plugin allows for creation of RoR application projects, generating the file structure within the Aptana IDE. Is there a way to do this for CI? Or is it simply copying and pasting of files into the proper location?

I'm fairly new to both products, so if this seems like a noob question, that's the reason, =)

Simply want to know the best way to set things up from people using this combination (CI, Aptana IDE).

Thanks


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

Username
  

Password
  





Latest Threads
Changing Session cookie -...
by paulbalandan
33 minutes ago
hot-reload side effects s...
by PaulC
5 hours ago
using app/Config/App.php ...
by sam547
Yesterday, 03:04 PM
Setting baseURL in Regist...
by grimpirate
05-15-2025, 02:20 PM
CRUD Code Generator
by DeanE10
05-15-2025, 05:31 AM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM
Update from 4.6.0 to 4.6....
by FlavioSuar
05-13-2025, 04:17 AM
Sessions old files are de...
by InsiteFX
05-12-2025, 10:30 PM
Ajax post failing with Ty...
by PaulC
05-12-2025, 12:23 AM

Forum Statistics
» Members: 146,541
» Latest member: pavestepcom9
» Forum threads: 78,392
» Forum posts: 379,464

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB