Re: array's first element is empty
Not sure if this is mod_perl related, but i hope someone can help me anyway. When i do DBI queries from mod_perl handler and put all returned results in array then array's first element is empty, I wonder why? I don't like to shift off first element every time i return the result. Has anyone seen this before and what could cause this? Unless you see different behavior when running under CGI, this is not a mod_perl question. I suggest you ask it on http://perlmonks.org/ and post a code sample with your question. - Perrin
array's first element is empty
Hello, Not sure if this is mod_perl related, but i hope someone can help me anyway. When i do DBI queries from mod_perl handler and put all returned results in array then array's first element is empty, I wonder why? I don't like to shift off first element every time i return the result. Has anyone seen this before and what could cause this? Rgds, Viljo
Re: array's first element is empty
Viljo Marrandi wrote: Hello, Not sure if this is mod_perl related, but i hope someone can help me anyway. When i do DBI queries from mod_perl handler and put all returned results in array then array's first element is empty, I wonder why? I don't like to shift off first element every time i return the result. Has anyone seen this before and what could cause this? This is off topic for mod_perl, and should as such either not be posted, or posted with a [OT] in the beginning of the subject line. The DBI mailing lists would be of greater help, listed here at: http://www.isc.org/services/public/lists/dbi-lists.html To answer your question, a query like: select nothing,something from table would have a undef value returned from the nothing column if the data in that column were NULL. You probably should remove the nothing column from your query instead of shifting the results. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: array's first element is empty
I don't think this is OT. I have had a similar error in which SELECT statements return fine under mod_cgi, but mysteriously get an extra null field underl mod_perl with Apache::DBI... I don't know what causes it, nor have I looked into it, but I think it is somewhat related to or caused by mod_perl or some of its' modules... Issac PGP Key 0xE0FA561B - Fingerprint: 7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B - Original Message - From: Joshua Chamas [EMAIL PROTECTED] To: Viljo Marrandi [EMAIL PROTECTED] Cc: modperl list [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 1:19 Subject: Re: array's first element is empty Viljo Marrandi wrote: Hello, Not sure if this is mod_perl related, but i hope someone can help me anyway. When i do DBI queries from mod_perl handler and put all returned results in array then array's first element is empty, I wonder why? I don't like to shift off first element every time i return the result. Has anyone seen this before and what could cause this? This is off topic for mod_perl, and should as such either not be posted, or posted with a [OT] in the beginning of the subject line. The DBI mailing lists would be of greater help, listed here at: http://www.isc.org/services/public/lists/dbi-lists.html To answer your question, a query like: select nothing,something from table would have a undef value returned from the nothing column if the data in that column were NULL. You probably should remove the nothing column from your query instead of shifting the results. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: array's first element is empty
Issac Goldstand wrote: I don't think this is OT. I have had a similar error in which SELECT statements return fine under mod_cgi, but mysteriously get an extra null field underl mod_perl with Apache::DBI... I don't know what causes it, nor have I looked into it, but I think it is somewhat related to or caused by mod_perl or some of its' modules... This sounds like it might be a bug then, and I might bring it up on the DBI list and see if there is a solution. It might be that something in the glue of Apache::DBI is causing this problem too, but would doubt that, as I believe this glue only overrides behavior for connect/disconnect. Note that I have never seen this bug, working with Oracle mysql under various perls mod_perl builds, so you might look at your particular software versions as having the problems, or even your particular database driver ( DBD::* ) for the problem. Also, sometimes DBD::* drivers are guided by %ENV settings, like Oracle, so make sure that your mod_perl has the same %ENV as your when running under mod_cgi. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: array's first element is empty
Well, I don't want to cry wolf (or Bug in this case). I wasn't going to bring it up except that this was getting shoved off of mod_perl, and I didn't think that it should... I'm not going to cry bug unless I can back it up - it just might be a fluke coincidence - I don't know. I just wanted to let people know. Issac PGP Key 0xE0FA561B - Fingerprint: 7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B - Original Message - From: Joshua Chamas [EMAIL PROTECTED] To: Issac Goldstand [EMAIL PROTECTED] Cc: Viljo Marrandi [EMAIL PROTECTED]; modperl list [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 1:38 Subject: Re: array's first element is empty Issac Goldstand wrote: I don't think this is OT. I have had a similar error in which SELECT statements return fine under mod_cgi, but mysteriously get an extra null field underl mod_perl with Apache::DBI... I don't know what causes it, nor have I looked into it, but I think it is somewhat related to or caused by mod_perl or some of its' modules... This sounds like it might be a bug then, and I might bring it up on the DBI list and see if there is a solution. It might be that something in the glue of Apache::DBI is causing this problem too, but would doubt that, as I believe this glue only overrides behavior for connect/disconnect. Note that I have never seen this bug, working with Oracle mysql under various perls mod_perl builds, so you might look at your particular software versions as having the problems, or even your particular database driver ( DBD::* ) for the problem. Also, sometimes DBD::* drivers are guided by %ENV settings, like Oracle, so make sure that your mod_perl has the same %ENV as your when running under mod_cgi. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051