مجید آنلاین هک شد - تابع mysql_query('set names utf8');

sodahost

Member
سلام دوستان من یه مشکلی داشتم تو فارسی نویسی در بانک اطلاعاتی
یه شخصی به من گفت این کد رو بزارم لای کد های PHP بعد فارسی رو درست میکنه
میشه کار دقیق این تابع رو بگید ?

and other code ...
mysql_query('set names utf8');
and other code ...




 

alireza82

Well-Known Member
کاراکتر ست ارتباط با سرور رو مشخص میکنه
کد:
Character set issues affect not only data storage, but also communication between client programs and the MySQL server.
 If you want the client program to communicate with the server using a character set different from the default, you'll need to indicate which one. 
For example, to use the utf8 Unicode character set, issue this statement after connecting to the server: 
SET NAMES 'utf8';
میتونید به وبلاگ من هم یه سر بزنید ، اطلاعات کاملتری در مورد استفاده از این دستور اونجا هست.
موفق باشید
 
آخرین ویرایش:

جدیدترین ارسال ها

بالا