The solution is pretty simple once you hit it, and works in both
MySQL and PGSQL because it's standard SQL-92 :
$query="SET NAMES 'UTF-8'";
Sorry - I meant $query="SET NAMES 'UTF8'";
As you pointed out, it's UTF8 not UTF-8 ;-)
Cheers - Neil
--
PHP Database Mailing List (http://www.php.net
At 01:18 23/07/2007, you wrote:
Message-ID: <[EMAIL PROTECTED]>
From: aldnin <[EMAIL PROTECTED]>
Subject: Re: [PHP-DB] PHP + PostgreSQL: invalid byte sequence for encoding
> This indicates that PHP not using UTF-8. That output is typical of
> UTF-8 output as Latin characters
>output_handler=mb_output_handler
This helped me to fix any output to the browser properly, so I don't need to do
any utf8_decode() any more, thanks.
> Setting it to "7" won't let me even echo something else.
Right, it's strange, but true... :-(
> mbstring.detect_order = UTF-8,eucjp-win,sj
thx a lot - what you're writing is really necessary to handle this problems in
the future.
The reason why I was looking for a faster solution is when you have to handle
huge data which is utf8, and sometimes not utf8... etc you understand what
I mean? ;-)
Bruno Lustosa wrote:
> On 7/21/07
On 7/21/07, aldnin <[EMAIL PROTECTED]> wrote:
When I try to send this query (select 'lacarrière' as test;) to a UTF8
initialized pgsql-database (8.2.4) from PHP 5.2.3 I get this error:
ERROR: invalid byte sequence for encoding "UTF8": 0xe87265
Short answer: start using utf-8 for just everyth
Hi
You still haven't answered whether you're using any output handler, and
if so which one. I use
output_handler=mb_output_handler
> I overloaded the mbstring variables with:
> mbstring.func_overload = 6
> Setting it to "7" won't let me even echo something else.
Very strange, the only addit
> You did not answer the most important question. What, if any, output
> buffering are you using? Are you using the mbstring module? If so, is
> it set to overload the old string functions?
Well, i checked for Multi Byte String functions, and it was enabled and
configured before compiling with
Hi
>
> Well, I searched all the source code of phpPgAdmin for charsets and I found:
>
> "echo "\t charset={$data->codemap[$dbEncoding]}\" />\r\n";"
>
> So this means, phpPgAdmin sets the output charset to the charset which
> is used by the databased connected to - but that's still not the
> pro
> Please configure your email client so we don't receive 5 copies of your
> mail.
Just fixed that issue, don't be afraid of that in the future.
> This indicates that PHP not using UTF-8. That output is typical of
> UTF-8 output as Latin characters.
Well, maybe the output is not correct - when r
Hi
Please configure your email client so we don't receive 5 copies of your
mail.
> I already did this and all encoding settings are right, but I figured out
> something more.
>
> 1) Using pg_query for fetching UTF8 data from database is working properly.
> Of course when I try to output it dir
> My guess is that your PHP is not setup to handle UTF8, and is really
> sending something else. UTF8 is the default client encoding because that
> is the encoding of the database. It does not mean that PHP has set the
> right one. Before running your test, try executing this: "SET
> client_encodin
> My guess is that your PHP is not setup to handle UTF8, and is really
> sending something else. UTF8 is the default client encoding because that
> is the encoding of the database. It does not mean that PHP has set the
> right one. Before running your test, try executing this: "SET
> client_encodin
> My guess is that your PHP is not setup to handle UTF8, and is really
> sending something else. UTF8 is the default client encoding because that
> is the encoding of the database. It does not mean that PHP has set the
> right one. Before running your test, try executing this: "SET
> client_encodin
> My guess is that your PHP is not setup to handle UTF8, and is really
> sending something else. UTF8 is the default client encoding because that
> is the encoding of the database. It does not mean that PHP has set the
> right one. Before running your test, try executing this: "SET
> client_encodin
> My guess is that your PHP is not setup to handle UTF8, and is really
> sending something else. UTF8 is the default client encoding because that
> is the encoding of the database. It does not mean that PHP has set the
> right one. Before running your test, try executing this: "SET
> client_encodin
On Jul 21, 2007, at 7:53 AM, aldnin wrote:
When I try to send this query (select 'lacarrière' as test;) to a
UTF8 initialized pgsql-database (8.2.4) from PHP 5.2.3 I get this
error:
ERROR: invalid byte sequence for encoding "UTF8": 0xe87265
I use pg_query for the query delivery.
Client
When I try to send this query (select 'lacarrière' as test;) to a UTF8
initialized pgsql-database (8.2.4) from PHP 5.2.3 I get this error:
ERROR: invalid byte sequence for encoding "UTF8": 0xe87265
I use pg_query for the query delivery.
Client Encoding is set to:
client_encoding
-
Hello,
I have problem with Unicode (UTF-8) data read from PostgreSQL 8.0,
processed in PHP 4.3.5 and inserted back to DB.
Situation:
database with unicode (utf-8) encoding
table customer
name varchar(30),
surname varchar(50)
table invoice_tmp
name varchar(70),
surname varchar(70)
Ther
Hi
I seem to be having a problem with my PHP-Postgresql
application. The program runs fine. However if the user
closes the browser window while its loading it causes my
postgresql to increase CPU usage to about 70%-80% and
decreases the speed of the subsequent requests. Also the
CPU usage remai
Hi,
I am trying to configure a webserver running iplanet
and php to connect to a postgresql server. My setup is
the following:
Web server: Solaris 2.6, iplanet 4.1, PHP 4.1
DB server: Linux 2.2.20 (debian woody), PostgreSQL
7.2.1.
I have built PHP under Solaris with the configuration:
./config
Hello,
I am rather new to Linux but an old timer at software development. I am
investigating alternate platforms for future development for my company.
Linux is at the top of the list.
I am trying to get a server setup with a db (PostgreSQL), web server
(Apache), and some sort of web scripting
Hi everyone:
I found the problem when retrieve data from table or field which are
mix-case. I means table or field name like "accommdationType". contain
lower and upper case character.
For example:
Query "select compID from table"
after pg_exec() --> "select compid from table"
Thus, I got
Hi there!
I am trying to use such combination of software: Apache
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem - some
postgres database admin script (php) says "Unable to connect to server
using user=user, password=password, etc".
May be php script tries to autheticate the us
: Jancs [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 31 August 2001 5:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] PHP+Postgresql/Win32
//
//
// Hi there!
// I am trying to use such combination of software: Apache
// 1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem - some
Hi there!
I am trying to use such combination of software: Apache
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem - some
postgres database admin script (php) says "Unable to connect to server".
I think i did everything i could - apache is running without problems, php
is configu
our actual query statement is
correct though, the one below is not.
> -Original Message-
> From: Smileyq [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 7:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] PHP+ postgresql help?
>
>
> Hey I'm new t
> print_r? Am I about to learn something new? Be still, my beating heart!
print_r will print the array $row which is one of the rows returned by
running your query. You can then see all the values in the array.
Just run it, you will see what it does.
Or alternatively echo just one field from
print_r? Am I about to learn something new? Be still, my beating heart!
On Tue, 21 Aug 2001, speedboy wrote:
> > $conn = pg_connect ("host=localhost user=username password=password
> > bname=dbname");
> >
> > $sql = "SELECT * FROM database where lower('$name%') order by last;";
> >
> $result =
> $conn = pg_connect ("host=localhost user=username password=password
> bname=dbname");
>
> $sql = "SELECT * FROM database where lower('$name%') order by last;";
>
$result = pg_exec($conn, $sql);
for ($i = 0; $i < pg_numrows($result); $i++) {
$row = pg_fetch_array($result, $i);
Hey I'm new to php and using databases. I've setup a postgres server and
have already populated the database. I'm able to connect the the server
just fine with php my problem is showing the results. Can somebody show
me a easy to understand example. For example. I've got a address book
databas
30 matches
Mail list logo