Posts filed under 'MySQL'

Getting weird characters with AMFPHP

Just a small reminder that might help anyone getting some weird characters with AMFPHP. It can happen when you copy a full text from Microsoft Word. And the quotes get inserted in your DB.

You might find some funny results like an Euro symbol appearing throughout your text. Uncomment this line in your amfphp gateway:

$gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1");

Here are some examples of text you might find:
‘ = This is the open double quote
’ = This is the close double quote

Here is a good resource if you’re having issues with strange characters and PHP / MySQL: ByteFlex - Fun with utf8, PHP and mysql

Add comment January 31st, 2008

MySQL (errno: 150)

Just quick note for anyone getting this error. It took me a little while to figure out.
In my case I was trying to add a foreign key with delete on cascade:

ALTER TABLE table_one
ADD CONSTRAINT name_fk FOREIGN KEY (iTable1ID)
EFERENCES table_two(iTable2ID) ON DELETE CASCADE;

And HeidiSQL was spitting out this error msg:

SQL Error: Can’t create table ‘.\database_name\#sql-72c_fb.frm’ (errno: 150)

How to resolve this error:
Make sure your fields datatype match.
They both should have exactly the same datatype and length.
Eg. INT(4) Unsigned isn’t the same as INT(11)

Also make sure if you have data in the table, the foreign keys will not fail.
Eg. If you have an value in one table and not in the other table, it will fail.

This may be common knowledge to most of you but it might come in handy to someone else.

3 comments January 17th, 2008


Calendar

December 2008
M T W T F S S
« May    
1234567
891011121314
15161718192021
22232425262728
293031  

Posts by Month

Posts by Category