Create queries.php

This is what I have in my queries file.  I may be mistaken but as I see it the first query is working as I can update existing pages however if I try to add a new page I get the error.  Is this not the 2nd query.  If it is the 2nd query then I do not understand why it is not working as through the testing phases during the tutorial I have had it working but now I have moved it it has somehow stopped.

The error I am getting is

Page could not be updated because: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

UPDATE pages SET user = 2, slug = 'SLUG', title = 'title test', label = 'label', header = 'Header', body = '

body test

' WHERE id =﻿

By the looks of it it is cutting the query off but it is using the update to create a page when I thought the 2nd query was for page creation?

Thanks