Jump to content

php mysql script displaying junk characters on RHEL 4.4 web server.


kcmakwana

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.