I keep getting the silly invalid byte sequence for encoding "UTF8": 0x96 error or whatever it is. Now I've identified it as a problem with my server space.
The thing is I migrated from a very similar database which was also UTF-8. I test out my PHP scripts on the first database and they work but on the one I require they do not. It must be a problem with encoding but I'm not sure what.
My PHP queries are failing on the new database and producing that error.
PHP:
$name = $_POST["name"];
$type = $_POST["type"];
$contact = $_POST["contact"];
$address = $_POST["address"];
$postcode = $_POST["postcode"];
$phone = $_POST["phone"];
$description = $_POST["description"];
$location = $_POST["location"];
$conn = pg_connect(/*DATABASE CONNECTION DETAILS*/);
$res = pg_query("INSERT INTO address (organisation_type, contact_name, address, postcode, phone_number, description, location_to_town, organisation_name) VALUES ('$type', '$contact', '$address', '$postcode', '$phone', '$description', '$location', '$name')");
pg_close($conn);
I mean that is a simple PHP write to database function and the only oddity is that of one UTF-8 database working and the other not. Is there any way I can compare the server/change the configurations of my PostGreSQL server at the command line?
Thanks any information would be much appreciated. Tearing my hair out over this!
Jimmy O'Hara.. it will probably get an error cause you are not escaping quotes.. unless you have magic_quotes ini option enabled (which is not recommended btw)..