Raven1313 Posted July 4, 2012 Share Posted July 4, 2012 I'm pulling Arabic Characters from a table and then inserting them into a different table but there it shows as ??????? instead of Arabic characters. Is there an INSERT INTO syntax that works for characters that are not English? Quote Link to comment Share on other sites More sharing options...
Raven1313 Posted July 4, 2012 Author Share Posted July 4, 2012 This is the insert into query: $sql=mysql_query("select PLAST,PREF,POPEN,PCLOSE,PBID,PVOL,PVALUE,PASK,NATIVE_TICKER from hist_sec where DATE(PDATE) = DATE(NOW()) "); $num=mysql_num_rows($sql); for($i = 0;$i < $num;$i++) { $arr1 = mysql_fetch_row($sql); $PLAST=$arr1[0]; $PREF=$arr1[1]; $POPEN=$arr1[2]; $PCLOSE=$arr1[3]; $PBID=$arr1[4]; $PVOL=$arr1[5]; $PVALUE=$arr1[6]; $PASK=$arr1[7]; $TICKER=$arr1[8]; $change1=($PLAST-$PREF)*100/$PREF; $change1=number_format($change1, 2, '.', ','); if($PLAST!="") { $mysql_query = mysql_query("INSERT INTO `mydatabase`.`loser_gainer` (`change` ,`Stock` ,`Last` ,`Vol`)VALUES ('$change1', '$TICKER', '$PLAST', '$PVOL')"); So basically I pull from hist_sec table and INSERT INTO loser_gainer table but when I check loser_gainer table I check the column STOCK and it contains "??????" characters instead of Arabic characters. Quote Link to comment Share on other sites More sharing options...
Raven1313 Posted July 4, 2012 Author Share Posted July 4, 2012 I think I managed to figure it out. In the database original and the one I am inserting into should have character set to UTF8 and collation UTF8_unicode_ci. Quote Link to comment 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.