Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Napster's avatar

Query Arabic text using DB with PDO

Hi, I'm trying to query some Arabic records using this code:

$pdo = DB::getPdo();

$statement = $pdo->prepare('select * from workers');

$statement->setFetchMode(\PDO::FETCH_ASSOC);

$statement->execute();

$results = $statement->fetchAll();

return view('payslips')->with('data', $results);

The Arabic text return as "" and can't see the values when I dd($results) I only see the english ones.

Checked the database and everything is there showing correctly but when I use Laravel to query it does that.

Please I need your help to find out why it returns empty strings instead of the actual Arabic text.

Thank You.

0 likes
2 replies
Alkut's avatar
Alkut
Best Answer
Level 3

try this instead

$results = DB::table('workers')->get();
return  view('payslips')->with('data',$results);

Please or to participate in this conversation.