Where have I been
I'm sure all ye faithful readers are wondering why I
haven't posted in two days....well it's kind of complicated really and
I'm going to explain. Just think about it, when I'm done you will
all be better people for it. This website runs from a
database. Think if a database as a really powerful MS Excel
spreadsheet. You have Columns and rows and different tables
(sheets). Unlike Excel, however, a database doesn't like certain
things. If I want words to appear in a cell, I have to tell it
that that cell will hold words. Kind of a pain, but if I want to
put a file in a cell, Excel would shit its pants, a DB would accept it,
provided it knew in advace that a file will be stored in the cell.
So the issue I had was that the cell that holds the post title is expecting words to include words in a cell the have to be surrounded by single quotes ( ' ) . This is not big deal, unless you want to put something like this in a database -> Don't worry be happy <- looks easy enough well what the database sees is 'Don't worry be happy'. The apostrophe in Don't makes the DB think that is the end of the string and thinks that "t worry be happy'" is a command (which it isn't) resulting in the shitting of a brick. There is a command in php that will add a (backslash) infront of special characters which will cause the DB to ignore that character so the string would look like 'Don't worry be happy'. I simply forgot to add the slashes and life as I knew it ceased to exist...at least temporarily. It's all better now so we can all sleep better now.
So the issue I had was that the cell that holds the post title is expecting words to include words in a cell the have to be surrounded by single quotes ( ' ) . This is not big deal, unless you want to put something like this in a database -> Don't worry be happy <- looks easy enough well what the database sees is 'Don't worry be happy'. The apostrophe in Don't makes the DB think that is the end of the string and thinks that "t worry be happy'" is a command (which it isn't) resulting in the shitting of a brick. There is a command in php that will add a (backslash) infront of special characters which will cause the DB to ignore that character so the string would look like 'Don't worry be happy'. I simply forgot to add the slashes and life as I knew it ceased to exist...at least temporarily. It's all better now so we can all sleep better now.
Comments
No comments yet — be the first.