Normally i don’t have big issues programming PHP and SQL, but i can’t really figure out what causes this little bug.
I have a page using PHP and fetching data from a MSSQL server.
I use PDO functions to fetch the data from SQL.
Most of the time it works perfect, but if i take out bigger text from the database, for example a Description of a product, Comments on a project etc. a wierd issue occurs.
Let’s say we use $data[‘Description’].
If that variable have longer texts most of the content shows up, but it get mixed with wierd PHP source code from a different file that have nothing to do with the specific position of the actual source code, or a lot of random chars. I thought it was a unicode problem, but i have no problem with æ ø å and letters like that.
For example
Housebox, stativer, komplet kabelsystem til ovenstående
Becomes
Housebox, stat@±¨tl ÿÿÿÿ@ d©tl
PA>A.PÒ-rl¨b¥tlÀn0rl ©tlø�ªtlp�ªtl0
jrld@x¥tliver, komplet kabelsystem til ovenstående
How is this possible?
I tried changing the unicode, but the unicode is correct.