if(in_array($request->get('post_type'), ['newQ', 'newP']))
{
$category = implode(",", $request->get('catBox'));
}
else {
$category = $request->get('catBox');
}
I recieved this error :
ErrorException in helpers.php line 747:
preg_replace(): Parameter mismatch, pattern is a string while replacement is an array
in helpers.php line 747
at HandleExceptions->handleError('2', 'preg_replace(): Parameter mismatch, pattern is a string while replacement is an array', 'D:\wamp\www\testSite\vendor\laravel\framework\src\Illuminate\Support\helpers.php', '747', array('search' => '?', 'replace' => array('test', array('appliances', 'Development'), 'Qtop', '1', '2016-06-21 07:46:34', '2016-06-21 07:46:34'), 'subject' => 'insert into posts
(body
, cat
, post_type
, user_id
, updated_at
, created_at
) values (test, ?, ?, ?, ?, ?)', 'value' => array('appliances', 'Development')))
That is a query error. Seems you are trying to insert an array in your cat field.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community