Up |
|
|
  |
Author: Peter H. CoffinPeter H. Coffin
Date: Dec 26, 2008 07:52
On 19 Dec 2008 15:49:32 GMT, End of Road wrote:
> Hello,
>
> I am retrieving data from a remote database in which text data is
> stored in the utf-8 charset, this data is meant to be displayed and
> generally used on pages that use the latin1 charset (ie iso-8859-1).
> I know I can go through the result set and translate text data to
> latin but on some occasions (for instance when I plug the data in a
> form) it would be much more convenient (let alone faster) to have the
> result already converted to latin. Is it just a matter of changing the
> collation on a per-query basis? How would I go about achieving this?
Set your output connection to the charset that you want the data
converted to. That'll mean reading and understanding
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html very
well, and writing your applications to account for possible data loss
from characters in the database that don't fit into latin1 mapping.
|
| Show full article (1.09Kb) |
|
| |
no comments
|
|
  |
Author: D A V ED A V E
Date: Dec 26, 2008 07:51
Always use manualy Query
(UPDATE table SET column = replace(column,"-","") WHERE `column` REGEXP '-')
My question:
How to build a "trigger" for the update database which removes the sign "-"?
|
| |
|
| |
1 Comment |
|
  |
Author: Bill HBill H
Date: Dec 26, 2008 04:27
I am relativly new to MySql so I may be doing this wrong. On a site I
am working on I have a table called block that looks like this:
primary key (auto inc)
owner id (key to account table)
blocked id (key to account table)
Where owner id and blocked id are keys into an account table.
The table has indexes on both the owner id and blocked id fields.
This table is used for users to block contact from other users. For
example if user id #1 didn't want to be contacted by user id #2 then
there would be an entry in the table where owner id = 1, and blocked
id = 2.
For a user to see all the users he has blocked I would select all rows
where owner id = the user who wants to know.
To test if a user is blocked from contacting another user I would
select where the owner id = user to be contacted and blocked id = user
who wants to contact.
This all seems straight forward and logical. The following is where I
wonder if I am doing it right.
|
| Show full article (1.61Kb) |
|
5 Comments |
|
  |
Author: Jerry StuckleJerry Stuckle
Date: Dec 26, 2008 03:31
Bill H wrote:
> On Dec 26, 5:32 am, Jerry Stuckle attglobal.net> wrote:
>> Bill H wrote:
>>> On Dec 26, 7:39 am, Luuk wrote:
>>>> Bill H schreef:
>>>>> I am relativly new to MySql so I may be doing this wrong. On a site I
>>>>> am working on I have a table called block that looks like this:
>>>>> primary key (auto inc)
>>>>> owner id (key to account table)
>>>>> blocked id (key to account table)
>>>>> Where owner id and blocked id are keys into an account table.
>>>>> The table has indexes on both the owner id and blocked id fields.
>>>>> This table is used for users to block contact from other users. For
>>>>> example if user id #1 didn't want to be contacted by user id #2 then
>>>>> there would be an entry in the table where owner id = 1, and blocked
>>>>> id = 2.
>>>>> For a user to see all the users he has blocked I would select all rows
>>>>> where owner id = the user who wants to know.
>>>>> To test if a user is blocked from contacting another user I would
>>>>> select where the owner id = user to be contacted and blocked id = user ...
|
| Show full article (3.52Kb) |
|
no comments
|
|
  |
Author: Jerry StuckleJerry Stuckle
Date: Dec 26, 2008 02:32
Bill H wrote:
> On Dec 26, 7:39 am, Luuk wrote:
>> Bill H schreef:
>>
>>
>>
>>
>>
>>> I am relativly new to MySql so I may be doing this wrong. On a site I
>>> am working on I have a table called block that looks like this:
>>> primary key (auto inc)
>>> owner id (key to account table)
>>> blocked id (key to account table)
>>> Where owner id and blocked id are keys into an account table.
>>> The table has indexes on both the owner id and blocked id fields.
>>> This table is used for users to block contact from other users. For
>>> example if user id #1 didn't want to be contacted by user id #2 then
>>> there would be an entry in the table where owner id = 1, and blocked
>>> id = 2.
>>> For a user to see all the users he has blocked I would select all rows ...
|
| Show full article (2.79Kb) |
|
4 Comments |
|
  |
Author: Jerry StuckleJerry Stuckle
Date: Dec 25, 2008 15:24
flycondor wrote:
> when I execute a sql of insert/update
>
>
> On 12月25日, 上午2时51分, Luuk wrote:
>> flycondor schreef:
>>
>>> I found many 'commit' in my slow query log
>>> does anyone know what's matter?
>>> example :
>>> # Time: 081223 23:40:49
>>> # User@Host: [user] @ appserver [ 192.168.1.5]
>>> # Query_time: 2 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
>>> commit;
|
| Show full article (1.37Kb) |
|
no comments
|
|
  |
Author: LuukLuuk
Date: Dec 24, 2008 10:51
flycondor schreef:
> I found many 'commit' in my slow query log
> does anyone know what's matter?
>
> example :
>
> # Time: 081223 23:40:49
> # User@Host: [user] @ appserver [ 192.168.1.5]
> # Query_time: 2 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
> commit;
|
| |
|
4 Comments |
|
  |
Author: FabriceFabrice
Date: Sep 23, 2008 04:00
Hello,
For me the moment I work with Mysql 5.0.41 and 5.0.51 under Windows.
I have just downloaded the last version 5.0.67
( mysql-essential-5.0.67-win32.msi).
How to upgrade each version without losing the configuration and data. Do I
have to reinstall Mysql ?
What is the best way to do that ?
thanks a lot
fabrice
|
| |
|
no comments
|
|
  |
Author: JunkoneJunkone
Date: Sep 22, 2008 17:17
i am trying a few combinations and they dont work.
update rawdatas r, rawdatas r1
set r.Created_at=r1.tradedatetime
where r.id=r1.id and r.processed_indicator is null;
i also tried
update rawdatas r set r.Created_at=r.tradedatetime
where r.processed_indicator is null;
|
| |
|
3 Comments |
|
  |
|
|
  |
Author: Thomas MlynarczykThomas Mlynarczyk
Date: Sep 22, 2008 05:19
Hello,
If I have the following tables:
first second
Id Foo Id Bar
1 10 3 35
2 20 4 45
3 30
And I want this result:
Id Foo Bar
1 10 NULL
2 20 NULL
3 30 35
4 NULL 45
What kind of JOIN must I use? I can have LEFT or RIGHT, but it seems
that here I would need both simultaneously. I thought there was such a
thing, but I couldn't find it in the manual.
Please help!
Greetings,
Thomas
|
| Show full article (0.52Kb) |
|
9 Comments |
|
|
|