i have a problem with the text field in a mysql databse. i am building a web page that shows lyrics from a databse, the field i use for the actuall lyrics is TEXT but if the song has an odd number of ' then when i try to edit it, phpmyadmin tells me that an error has ocurred because of a unclosed '. if the song has an even number of them nothing happens because all the ' are closed. is there any chance that if i choose another field type this wouldn't happen? in case there isn't is there anything i could do besides counting the ' and make them even each time i insert a lyric?
using BLOB?
When putting the lyrics into the DB field you should escape the ' with \'
In PHP you'd do this with the addslashes command, then when you pull the lyrics out of the DB use stripslashes to remove the escaped characters...
HTH,
how exactly does this work? is it a command for the php page or for phpmyadmin?
It's a PHP command.
http://www.php.net/manual/en/function.addslashes.php
http://www.php.net/manual/en/function.stripslashes.php
ok thanks