comp.databases.mysql
  Home FAQ Contact Sign in
comp.databases.mysql only
 
Advanced search
December 2008
motuwethfrsasuw
1234567 49
891011121314 50
15161718192021 51
22232425262728 52
293031     1
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.databases.mysql Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: convert result set from utf-8 to latin         


Author: Peter 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
  REGEXP and CREATE TRIGGER         


Author: D 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
  Is there a better way?         


Author: Bill 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
  Re: Is there a better way?         


Author: Jerry 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
  Re: Is there a better way?         


Author: Jerry 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
  Re: 'commit' in slow query log?         


Author: Jerry 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;
>> (http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html)
>> "The slow query log consists of all SQL statements that took more than
>> long_query_time seconds to execute and "
>>
>> and COMMIT, is a SQL statement...
>> ...
Show full article (1.37Kb)
no comments
  Re: 'commit' in slow query log?         


Author: Luuk
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;

(http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html)
"The slow query log consists of all SQL statements that took more than
long_query_time seconds to execute and "

and COMMIT, is a SQL statement...

so, what's the question ?
4 Comments
  How to upgrade mysql         


Author: Fabrice
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
  how to update col 1 from col 2 of same table         


Author: Junkone
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
  Stupid JOIN quesion         


Author: Thomas 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
1 2 3 4 5 6 7 8 9