When I am useing small string value for database field then my code work's properly but its not work with long string value
My code with small string and its work for me:
$legal_restrictions = "TEST DATA";
$detail = "TEST DATA DETAIL";
$db = Zend_Db_Table::getDefaultAdapter();
$sql = "exec usp_add_offer '$legal_restrictions' ,'$detail'";
try{
$calPro = $db->prepare($sql);
} catch(Zend_Exception $e) {
print_r($e);
}
$calPro = $db->prepare($sql);
$calPro->execute();
$data = $calPro->fetch();
Code not work with long string value
$legal_restrictions = "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing.If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing";
$detail = "TEST DATA DETAIL";
$db = Zend_Db_Table::getDefaultAdapter();
$sql = "exec usp_add_offer '$legal_restrictions' ,'$detail'";
try{
$calPro = $db->prepare($sql);
} catch(Zend_Exception $e) {
print_r($e);
}
$calPro = $db->prepare($sql);
$calPro->execute();
$data = $calPro->fetch();
My store procedure:
USE [pnp]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_test]
@test varchar(max),
@description varchar(max)
AS
BEGIN
SET NOCOUNT ON;
insert into tbltest
(
test,
description)
values
(
@test,
@description)
select 1
END
Please provide me the best solution of this problem