Re: [PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Stut
Man-wai Chang wrote:
 create table temp ( big5 char(2) ) character set big5 collate big5_bin;
 insert into temp ( big5 ) values ( 0x9f54 );
 insert into temp ( big5 ) values ( 0x9f53 );
 The 2nd query will report duplicated key. How should I fix the problem?
 What does this has to do with PHP?
 First of all I don't see any PHP code, and second this is an error in
 your SQL query, so you should be on the MySQL list.
 
 I used mysqli_query() to send the SQL. How could I make it work?

That really doesn't make this question PHP-related. You really do need
to ask on a MySQL mailing list. This has nothing to do with PHP, and
you're more likely to get a useful answer from a MySQL-specific list.

If you really want to try and justify asking this question here, try the
queries in the command-line MySQL client. If it works there but not
through mysqli_query() then you might have a case for asking here.

-Stut

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Man-wai Chang
 queries in the command-line MySQL client. If it works there but not
 through mysqli_query() then you might have a case for asking here.

For the 13081 chinese alphabets I tried, only 1 one failed, and it's
0x9f54. mysqli_query() should have escaped the string for me. So ...

I suppose most PHP programmers are also experts in MySQL (they are
basically tied). SO I tried my luck here. :)

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.4
  ^ ^   21:24:01 up 1 day 8:36 0 users load average: 1.00 1.02 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Jochem Maas
Man-wai Chang wrote:
 queries in the command-line MySQL client. If it works there but not
 through mysqli_query() then you might have a case for asking here.
 
 For the 13081 chinese alphabets I tried, only 1 one failed, and it's
 0x9f54. mysqli_query() should have escaped the string for me.

mysqli_query() doesn't escape anything for you - your assumption that
it *should* is WRONG.

try this: http://php.net/manual/en/function.mysqli-real-escape-string.php

 So ...
 
 I suppose most PHP programmers are also experts in MySQL (they are
 basically tied). 

incorrect supposition. most php programmers have experience using
RDBMs because of the dynamic nature of the websystems they build.

mysql and php and not tied at all .. they just happen to be used together
frequently.

 SO I tried my luck here. :)
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-24 Thread Man-wai Chang
 create table temp ( big5 char(2) ) character set big5 collate big5_bin;
 insert into temp ( big5 ) values ( 0x9f54 );
 insert into temp ( big5 ) values ( 0x9f53 );
 The 2nd query will report duplicated key. How should I fix the problem?
 What does this has to do with PHP?
 First of all I don't see any PHP code, and second this is an error in
 your SQL query, so you should be on the MySQL list.

I used mysqli_query() to send the SQL. How could I make it work?

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.4
  ^ ^   14:43:01 up 1 day 1:55 0 users load average: 1.01 1.02 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php