I am getting an error saying I am calling an undefined function using pg_query() - would this mean I have a version of php that pg_query does not work with?
Probably not a version problem, but an installation issue: most likely PHP was not installed with the Postgre option (see http://www.php.net/manual/en/pgsql.installation.php).