Hướng dẫn mysqli_query set names utf8
I'm fetching data in Arabic from MySQL tables with MySQLi. So I usually use this in procedural style:
Now I am using the OOP style so I am trying to see if there is something I could set rather than the above? I only found this in PHP manual so I did it, but what about setting names to UTF8?
Mark Amery 131k78 gold badges392 silver badges441 bronze badges asked May 31, 2012 at 8:19
2 It's the same: $mysqli->query("SET NAMES 'utf8'"); From the manual:
answered May 31, 2012 at 8:24
xdazzxdazz 156k36 gold badges240 silver badges268 bronze badges 4 You should use
Don't use
It's thus good practice to only use
answered May 2, 2016 at 13:12
Mark AmeryMark Amery 131k78 gold badges392 silver badges441 bronze badges You can use this. Its realy nice for mysqli Character Set
answered Oct 24, 2017 at 15:39
0 For procedural style lovers.
answered Nov 21, 2017 at 9:56 1
$conn = connection string answered May 2, 2016 at 10:43
alpcalpc 5383 silver badges6 bronze badges 1 Not the answer you're looking for? Browse other questions tagged php mysqli or ask your own question. |