View Full Version : MySQL question
souleaterjh
07-21-2005, 04:36 PM
How can i change Collation for use sql command "UNION". because i got error like "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'UNION' ".
Thank you in advance.
ns1987
07-21-2005, 04:56 PM
The problem is in the coallation of your columns - change those.
(Give me a dump of one of your tables and your query and I'll tell you what to change to what.)
souleaterjh
07-26-2005, 08:49 AM
Thank you so much... this is the dump:
SELECT 1 as type,a.profile_Name as Name, a.profile_Lastname as Lastname, a.profile_Email as Email, a.profile_City as City, a.profile_Country as Country FROM tbl_profile a WHERE a.profile_Status = 'Active' UNION SELECT 2 as type,b.opt_Name as Name,'' as Lastname, b.opt_Email as Email,'' as City, '' as County FROM tbl_opt b WHERE b.opt_Status = 'Active'
Glad you can help.
ns1987
07-26-2005, 04:55 PM
I actually meant a table dump. (Export -> Dump table)
But the problem is in the definitions of your table - they are different from the bihira default - you need to change them (or add using CHARSET in your queries, but that's annoying).
souleaterjh
07-28-2005, 07:39 AM
i change it already and query is ok right now. but i don't know why php script can't Execute that query. i try to echo query and copy it to run in phpMyadmin. it can execute. so i try to run it on my localhost with same php script. the page can execute. how can i do?
P.S. i use ADODB V4.65 connect
Thank you.
ns1987
07-28-2005, 10:11 AM
I'm 90% sure that the problem lies within ADODB. (Since the query runs in phpMyAdmin just fine), try asking in their forums. :/
souleaterjh
08-01-2005, 07:34 AM
so why i can execute my php on another server or my localhost by same source code and same ADODB connection. ?_?
ns1987
08-01-2005, 10:18 AM
Wait, you're using the SAME adodb connection?
<quote> try to echo query and copy it to run in phpMyadmin. it can execute.</quote>
phpMyAdmin doesn't use adodb to connect, iirc.
souleaterjh
08-02-2005, 04:03 AM
i mean "i try to run query directly by phpMyAdmin and i try to run my php source by browser on my localhost and on another server too." all of it can excute. that mean my ADODB not work? i need u to check something about php config or another have something conflict or not on your server.
thank you
souleaterjh
08-25-2005, 04:05 AM
anyone hear me? :(