Incidentally, you're assigning the values to new variables at the beginning of the loop, but you're not using them. Also, looking inside the commented code, you're using $elemt which won't be set at all.
I think you should be using $title, $content and $time as they're the variables you have created.
Edit: Another incidentally, if in your MySQL table you set the title column to a unique index, you won't have to use a SELECT to check if it first exists. It simply won't be entered into the MySQL table if it already exists.
One step at a time though !
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.