surfsup Posted September 20, 2007 Share Posted September 20, 2007 Never come across this before but I have simple form that submits text to a MySql database - The £ sign is being entered into the database as � .I can't seem to see why. I have tried rectifying the problem when I display the data with str replace to no avail. Any help appreciated (perhaps this should have gone n the My Sql forum but hey Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/ Share on other sites More sharing options...
darkfreaks Posted September 20, 2007 Share Posted September 20, 2007 <?php $variable=mysql_real_escape_string($variable); ?> this should help alot. Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351731 Share on other sites More sharing options...
darkfreaks Posted September 20, 2007 Share Posted September 20, 2007 http://www.mydatabasesupport.com/forums/ms-sqlserver/223033-sendstringparametersasunicode.html this might help too Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351744 Share on other sites More sharing options...
surfsup Posted September 20, 2007 Author Share Posted September 20, 2007 Pardon my ignorance. A little bit of a novice here.. Right well the mysql_real_escape_string does a good deal as you say . However the one thing it doesn't seem to to effect is this � The second point I can't quite work out what to do here. I have tried attaching the SendStringParametersAsUnicode=true in the connection string but it is giving me errors <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_Surgical = "IP"; $database_Surgical = "DB"; $username_Surgical = "US"; $password_Surgical = "PS"; SendStringParametersAsUnicode=true; $Surgical = mysql_pconnect($hostname_Surgical, $username_Surgical, $password_Surgical) or trigger_error(mysql_error(),E_USER_ERROR); ?> Could this be that I am inputting the information into a long text field Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351803 Share on other sites More sharing options...
effigy Posted September 20, 2007 Share Posted September 20, 2007 What is meta's charset defined as on the form page? What character set are the MySQL tables? Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351815 Share on other sites More sharing options...
darkfreaks Posted September 20, 2007 Share Posted September 20, 2007 according somewhere i read you need to use varchar not longtext Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351834 Share on other sites More sharing options...
darkfreaks Posted September 20, 2007 Share Posted September 20, 2007 try utf8_decode function read up on it on php.net Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-351879 Share on other sites More sharing options...
surfsup Posted September 21, 2007 Author Share Posted September 21, 2007 Ok VARCHAR made no difference. however... I have never had issues with charac set beofre but ultimately you were right meta's charset was UTF-8 whilst the character set of the database was set to Latin1 So problem solved . thanks Quote Link to comment https://forums.phpfreaks.com/topic/70040-solved-%C2%A3-sign-problems/#findComment-352632 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.