Not inserting more than 300 characters using MSSQL query with PHP, using Zend_db_adapter

158 views Asked by At

When I try to insert a string containing more that 300 characters it shows blank page and does not return any PHP error.

I am using ZF 1 - Zend db Adapter with MSSQL server 2012.

$db = Zend_Db_Table::getDefaultAdapter();
$insert = "insert into tbloffer (legal_restrictions) values ('more than 300 character string')";
$stmt = $db->prepare($insert);
$stmt->execute();

my database column datatype is nvarchar(max)

1

There are 1 answers

0
Indrasinh Bihola On BEST ANSWER

In Place of

$insert = "insert into tbloffer (legal_restrictions) values ('more than 300 character string')";
$stmt = $db->prepare($insert);
$stmt->execute();

Try this one

$data = array('legal_restrictions'=> 'more than 300 character string');
$db->insert('tbloffer',$data);