kcmakwana Posted January 26, 2011 Share Posted January 26, 2011 I have one mysql table with data and accessing this data through one php script. This works fine in REDHAT 8 linux. I have shifted mysql database and the php script to new server with REDHAT RHEL4.4. now when I execute the script from website, it displays junk character (reading form mysql database through php script). There is no error in mysql database/table and script is working fine in redhat 8. I have checked php.ini for default characterset as well as set the encoding in mysql as latin1. Where else should I look/change? any idea? Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted January 26, 2011 Share Posted January 26, 2011 Can you provide an example of the junk characters? (as output from your browser) compared to the REDHAT 8 output? Quote Link to comment Share on other sites More sharing options...
kcmakwana Posted January 31, 2011 Author Share Posted January 31, 2011 if i query from mysql prompt, it shows everything correct. All the data is in english,no other language used. but when I access it through web server, browser shows junk characters. but we can not doubt php script, as the same script is working ok in another server. I will try to get snapshot of the page and will post Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted January 31, 2011 Share Posted January 31, 2011 Yes it will be handy to know which characters it is displaying. you say you have checked the encodings, can you tell us what encoding your (trying) to use in php, and what encoding the mysql table is under. Also, try a new test script that just selects some rows, it is possible there is a bug in your code or even a bug in the PHP installation itself, if other test code throws the same junk data then it could be your mysql extension for PHP, or some other misconfiguration. If the test code does not throw any junk data then more than likely there is some bug in your code that you will have to track down. Are you echoing the query, and the result, as soon as you query mysql? 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.