Getting Started

I've been having this kind of problem for a very long time now and I'm still not sure how I can fix this. You see in mysqldatabase named examplebb I have 4 column named name, email, password, id(it is automatically generated so its not a problem) and diary. In my form I got name, email and password and I wanted to insert these three and its not letting me because of the diary column that I have and Updating a diary to my database is not letting me do it because of the three other columns and I basically don't know what to do on how to fix this plus I got Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in /home/daltonnapala/public_html/mysql/updatediary.php on line and as I search in the internet it say its about the $query not being a string and when I changed it, it is the same.