Jump to content

win32 exception in calling store procedure with limit as parameter


finalight

Recommended Posts

here's a problem, i have this stored procedure :

DELIMITER $$

 

DROP PROCEDURE IF EXISTS `hotel`.`test` $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `test`(recordStart int,

endStart int)

BEGIN

SET @lim = CONCAT(' LIMIT ', recordStart, ',', endStart);

  SET @test = "SELECT * FROM event";

 

  SET @q = CONCAT(@test, @lim);

  PREPARE st FROM @q;

  EXECUTE st;

  DEALLOCATE PREPARE st;

END $$

 

DELIMITER ;

 

 

and this is how i execute the stored procedure

 

function test($upper, $lower){

        $sql = "CALL test(?,?)";

        $mainArr = array();

        $sqlP = $this -> conn -> prepare($sql);

$sqlP -> bind_param('ii',$upper, $lower);

        $sqlP -> execute();

 

        //bind the result to the following variable(s)

        $sqlP -> bind_result($col1, $col2, $col3, $col4, $col5, $col6);

//

//        //Retrive the result

//

        $result = $sqlP -> store_result();

 

      while($sqlP -> fetch()){

            $arr = array();

            $arr[0] = $col1;

            $arr[1] =  $col2;

            $arr[2] =  $col3;

            $arr[3] =  $col4;

            $arr[4] = $col6;

 

            array_push($mainArr, $arr);

        }

        return $mainArr;

    }

 

whenever i invoke this function, it will give me this pop up alert stating that 'an unhandled win32 exception occured in apache.exe[errCode]', the 'errCode' is different everytime though.

 

however when i execute other stored procedures, nothing happen at all

 

i'm using easyphp bundle for this development project

 

can anyone tell me how to solve this error?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.