I have simple part of code:
$r=Input::get('r'); $sql='SELECT * FROM `table` WHERE `name`=?'; $dis=DB::connection('old-dis')->select($sql, [$r]);
When $r don’t has spaces, everything works corretly. But when $r is for simple
teddy bear Laravel show me error and doesn’t add
' ' to my text. I find next solution:
if(strpos($r,' ')) $r="'$r'";
Anyone has better way to fix it?