From:             [EMAIL PROTECTED]
Operating system: Solaris
PHP version:      4.1.0
PHP Bug Type:     Feature/Change Request
Bug description:  improving eval() with context

Hello,
this request is related to #15101.
Sample:

function a($like){
        $id, $name array;
        $val = "select ID, NAME from PEOPLE where NAME like\"{$like}\" into $id,
$name";
        $x = getContext();
        sql_fetch_array($val, $x);
        show_result($id, $name);
}

function sql_fetch_array($query, $context){
        ...there we separate into part of query, 
        run i.e.mysql_fetch_array into $result,
        for each resulting row we run something 
        like this:
        eval("$id[".$index."] = ".$result[ID], $context);
}

The thing logic is, that we can change variables ouside its regular
scope.
In this example we do it by previously saved "context". I propose this
type 
of solution, because I have it already in my previous development tool.
Maybe exist any more possibilities, how to do that.
This is useful to write many of general functions for (in my case) high 
quality SQL support.
If any other question about this, write me.
Best regards,
Tomas Polak
-- 
Edit bug report at: http://bugs.php.net/?id=15135&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to