Getting nulls when nserting Mysql values into sqlite special characters

m643

Member
Licensed User
Longtime User
Hi,

I'm trying to insert some text with special characters like éé or ë into my sqlite db (column=plot TEXT). Problem is that it saves null values when the text containts special characters. In my mysql database the field has utf8 as collation.

How can I solve this?
 

m643

Member
Licensed User
Longtime User
Have you added the PHP line that sets the encoding to UTF8? It is a single line that you need to add to the PHP script. I've added it in the MySQL tutorial.

Do you mean the line in the query: mysql_query("SET CHARACTER SET utf8");?

I also tried $string= utf8_encode ( $plot);
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
In my php I had to set
B4X:
mysql_query( "SET NAMES utf8", $con);
mysql_query( "SET CHARACTER SET utf8", $con);
Worked for me.
 
Upvote 0

m643

Member
Licensed User
Longtime User
In my php I had to set
B4X:
mysql_query( "SET NAMES utf8", $con);
mysql_query( "SET CHARACTER SET utf8", $con);
Worked for me.

I tried this but still getting nulls. How do you create the columns in sqlite, just "plot TEXT"?
 
Upvote 0
Top