insert greek characters in my sql database
insert greek characters in my sql database
i m using DataTables Editor.how can i insert greek characters in my sql database.With other applications the < mysql_query("SET NAMES 'utf8'", $con); > works for me..How can I get that to work in datatable editor? How can I get that to work?please help me on this.
This discussion has been closed.
Replies
What you can do is use the Database class `sql` method:
https://editor.datatables.net/docs/current/php/class-DataTables.Database.html#_sql
So you might use:
[code]
$db->sql( "SET NAMES 'utf8'" );
[/code]
Allan
The utf8 question has cropped up here more than once. Maybe it would be worth writing a commented example into the Bootstrap?
Speaking of the Bootstrap: "// Database connection it globally available" should be *is* ;-)
Yes, it might be worth me putting a comment in about the UTF8 connection. I've assumed that the db, and the html page will both use the same character set, which shouldn't cause any issues, regardless of what character set is used, since Editor / DataTables don't care about the character set. I'm surprised by how often this does crop up to be honest.
Allan
I just noticed that my cdn use of jquery does not specify a charset:
script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
whereas my local requirement of dataTables does;
script type="text/javascript" language="javascript" charset="utf-8" src="js/jquery.dataTables.min.js">
Could that be relevant?
Allan
Yep.
Allan