PHP-MySQLi-Database-Class icon indicating copy to clipboard operation
PHP-MySQLi-Database-Class copied to clipboard

[ADD] Executes procedures and functions

Open supr3m opened this issue 9 years ago • 2 comments

i needed execute a procedure mysql, that's it.

supr3m avatar Mar 16 '16 18:03 supr3m

thank you for your contribution. Patch looks very hovewer there are bunch of problems:

  1. You have introduced new functionality but havent updated a readme examples on how to use them.
  2. Patch is incompatible with old php because of [] vs array() usage.
  3. Patch is incompatible with an ArrayBuilder/ObjectBuilder/JsonBuilder() modifiers
  4. Im not sure if you need callFunction() as you still can use get("function(args)")
  5. you are missing new tests for a new functionality

Can you please fix this issues and I will be glad to merge it.

avbdr avatar Mar 16 '16 19:03 avbdr

i needed execute a procedure mysql, that's it.

I also needed to send NULL values so I have changed _validParams to support NULL values.

From this:

        foreach ( $params as $key => &$param ) {
                $param = "'". $this->mysqli()->real_escape_string( $param ) ."'";
        }

To this:

        foreach ( $params as $key => &$param ) {
            if ($param)
                $param = "'". $this->mysqli()->real_escape_string( $param ) ."'";
            else
                $param = 'NULL';
        }

MPrtenjak avatar Jan 27 '21 07:01 MPrtenjak