Support the ongoing development of Laravel.io →
posted 8 years ago
Requests
Last updated 2 years ago.
0
if(in_array($request->get('post_type'), ['newQ', 'newP']))
{
    $category = implode(",", $request->get('catBox'));
}
else {
    $category = $request->get('catBox');
}
0

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')))

0

That is a query error. Seems you are trying to insert an array in your cat field.

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

asakre asakre Joined 23 May 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.