that code:
GetSQLValueString($colname_PageContents, "text"),GetSQLValueString($colname_PageContentsPerm, "text"));
is how the variables are added to the SQL.
in MySQLi, the variables are added to the SQL using these 2 lines:
$PageContents->bindParam("s", "".$_GET['id'] ."", "-1"); //colname
$colname_PageContentsPerm->bindParam("s", "".$_GET['perm'] ."", "-1"); //colname