Jon Coulter | 5 Mar 22:10 2007

_adodb_column_sql and integers?

I'm using the postgresql driver, and whenever I pass a value to AutoExecute(...), the adodb driver gets really lazy at the _adodb_column_sql() step (which is what I want to do :))
 
Basically, if I have a field defined as an integer in the database, but I let '10a' pass into the system, I would rather adodb quote the data before sending it to the server (set intfield = '10a') and let the database throw an error, then postgres assuming I have done the correct casting and passing it as (set intfield = 10a), which is what it does.
 
This would leave a lot of room for SQL injection bugs.  One of the main reasons I want to use an abstraction library like adodb is so I don't have to be hugely tedious with casting data types and things like that.  Granted, I'm being lazy in this case, but the fact remains that this is a big problem for people whom just didn't "test" their code well enough and relied on adodb to properly quote things, regardless of what the meta information about the table says the data type is.
 
I've also never seen a database throw an error if a column is defined as an int, and an int is passed to it in quote ('123') -- so I don't see any problem with just forcing a quoting policy across all non-special-case data types (BLOB is a special case) and letting the rest of us concentrate on business logic instead of data type casting in a loosely-typed language like PHP.
 
Anybody else have thoughts on this, or similar experiences?
 
Thanks,

--
Jon Coulter
ledjon <at> ledjon.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
Raghvendra Chourasia | 6 Mar 08:06 2007
Picon

ADODB readonly mode is not working (PHP and Oracle)

Hi,
I am connecting PHP 5 with Oracle 10g Express Edition using ADODB, Operating system is Windows XP Professional. I want to access data in read only mode. When I did changes $readOnly = true; in adodb.inc.php even though I am able to run insert,update, delete query. Why Read Only mode is not working when I connect PHP with Oracle. Any solution plz.
Thanks,
Ajit


Hi,
Raghvendra S Chourasia
 
flat no.201 , Umang Apts,
Nari Ring Road, Angulimaal Nagar,
Nagpur -26
 
Cell no. -9850302388
 

Here’s a new way to find what you're looking for - Yahoo! Answers
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
Raghvendra Chourasia | 6 Mar 08:15 2007
Picon

ADODB readonly mode is not working (PHP and Oracle)

Hi,
I am connecting PHP 5 with Oracle 10g Express Edition using ADODB, Operating system is Windows XP Professional. I want to access data in read only mode. When I did changes $readOnly = true; in adodb.inc.php even though I am able to run insert,update, delete query. Why Read Only mode is not working when I connect PHP with Oracle. I saw php function like oci_connect() but I could not get any option like readonly.
Any solution plz.
Thanks,
Ajit

Here’s a new way to find what you're looking for - Yahoo! Answers
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
Erik Wickstrom | 8 Mar 23:30 2007

Redirect Debug Output?

Hi,

I need to customize the debug output of ADOdb.  Is there a function that can be overloaded, or maybe some other "hook" that cane be used?

Basically I need to put the debeg output into an array instead of printing it tho screen...

Thanks for your help!

Erik

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
Chris Edwards | 9 Mar 01:53 2007
Picon

Re: Redirect Debug Output?

Erik Wickstrom wrote:
> Hi,
> 
> I need to customize the debug output of ADOdb.  Is there a function that 
> can be overloaded, or maybe some other "hook" that cane be used?
> 
> Basically I need to put the debeg output into an array instead of 
> printing it tho screen...
> 
> Thanks for your help!
> 
> Erik
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ADodb-general mailing list
> ADodb-general <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/adodb-general

wrap the call with an output buffer.  ob_start()

look it up on php.net

--

-- 
Chris Edwards
Software Engineer, Nullsoft Winamp
AOL
http://www.winamp.com
edwardschris05 <at> aol.com / 703-265-1840

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Bartłomiej Pióro | 9 Mar 09:07 2007
Picon

Re: Redirect Debug Output?

Hello

This is what i am using (this works without touching ADODB at all).

define('ADODB_OUTP',"nameOfTheFunction");
function outputDebug($text,$newline)
{
	// Do here what you want to do
}

Hope this helps
Regards
Bart

Erik Wickstrom napisał(a):
> Hi,
> 
> I need to customize the debug output of ADOdb.  Is there a function that 
> can be overloaded, or maybe some other "hook" that cane be used?
> 
> Basically I need to put the debeg output into an array instead of 
> printing it tho screen...
> 
> Thanks for your help!
> 
> Erik
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> __________ NOD32 Informacje 2104 (20070308) __________
> 
> Wiadomosc zostala sprawdzona przez System Antywirusowy NOD32
> http://www.nod32.com lub http://www.nod32.pl 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ADodb-general mailing list
> ADodb-general <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/adodb-general
> 
> 
> __________ NOD32 Informacje 2104 (20070308) __________
> 
> Wiadomosc zostala sprawdzona przez System Antywirusowy NOD32
> http://www.nod32.com lub http://www.nod32.pl 
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general
Bartłomiej Pióro | 13 Mar 15:27 2007
Picon

AdoDB Fatal Error under PHP 5.2 -> Solution

Hello,

If you are using PHP 5.2 you can sometime see the error :
Nesting Level to deep .....

This is because 5.2 differntly behave in some situations (see 
http://www.bigroom.co.uk/blog/php-nesting-level-too-deep-recursive-dependency/ 
for more info).

To correct this error you have to go to adodb-active-record.inc.php
and modify line no 45:

Before :
if ($d->db == $db) return $k;

After :
if ($d->db === $db) return $k;

I need confirmation from adodb author about this, but this solution 
seemed to work for my case.

Hope this helps if someone encounter error like mine.

Regards
Bart

PS: This works correctly under windows Apache Friends basic installation 
with 5.2
B

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Paolo Morandi | 15 Mar 10:56 2007

AutoExecute UPDATE problem with oci8

I have a problem with AutoExecute in oci8 interface.
My call are:
AutoExecute('utenti', array of fields to update, 'UPDATE',
"cod_utente='prova'")
This call fail.
If i look the sql generated i find:
UPDATE utenti SET ........ WHERE cod_utente='prova') where rownum <=
:adodb_offset

In adodb-lib.inc.php function _adodb_getupdatesql after the line 465:
        preg_match('/\sWHERE\s(.*)/is', $rs->sql, $whereClause);
The element 1 of  $whereClause field are: cod_utente='prova') where
rownum <= :adodb_offset

Can help me?

An other help: i must make portable this MySql SQL statement:

    select data_scadenza, successivo from pagine where ((data_scadenza
    between date_sub('2007-03-14', INTERVAL '25' day) and
    date_add('2007-03-14', INTERVAL '26' day)) or (data_scadenza <
    date_sub('2007-03-14', INTERVAL '25' day) and
    date_add(data_scadenza, INTERVAL successivo day) >=
    date_sub('2007-03-14', INTERVAL '25' day))) and tipo_pagina='C' and
    lingua='IT'

I have maked two Database Function in Oracle for simulate date_sub and
date_add , but my problem are the execution of the interval on the table
field 'successivo' (an integer). The function are:
DATE_ADD:

    CREATE OR REPLACE function date_add(data1 in STRING, intervallo IN
    INTERVAL DAY TO SECOND )
    return date IS
    data2 DATE;
    BEGIN
    select to_date(data1, 'yyyy-mm-dd') + intervallo into data2 from dual ;
    return(data2);
    END;
    /

DATE_SUB:

    CREATE OR REPLACE function date_sub(data1 in STRING, intervallo IN
    INTERVAL DAY TO SECOND )
    return date IS
    data2 DATE;
    BEGIN
    select to_date(data1, 'yyyy-mm-dd') - intervallo into data2 from dual ;
    return(data2);
    END;
    /

Any suggestion?

Thank

Paolo Morandi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
chamath gunasekara | 23 Mar 05:42 2007
Picon

Hello ....

Hi ....
    
           I'm chamath from sri lanka. I'm a student of university of colombo school of computing. I'm 3rd year undergraduate.

regards,

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general

Gmane