Jump to content

win32 exception in calling store procedure with limit as parameter


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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.