Re: Wait for data to change

2005-03-22 Thread Ben Clewett
Shawn,
I like your idea very much.  Unfortunately I am not using version 5 yet, 
but this may hasten my upgrade.

My initial thought was to try and find a function like PostgreSQL's 
LISTEN command 
(http://www.postgresql.org/docs/8.0/interactive/sql-listen.html).  But I 
think this method is better.

As an extension to your idea, my UDF function can broadcast messages 
using the RSS protocol.  I am sure there are some easy to use libs out 
there.  My listening thread(s) can feed off the RSS listening for 
trigger events.

This negates the use of a polling thread, and indeed the entire thread. 
I don't need a connection to the database at all until I know there is 
data there.  Magic :)

Thanks,
Ben.
[EMAIL PROTECTED] wrote:
Ben Clewett [EMAIL PROTECTED] wrote on 03/21/2005 11:36:45 
AM:


Dear MySQL,
I have an application which need to wait for some data to change, then 
act on this change.

I am polling the MySQL once a second using SELECT ...
I believe there is an alternate method where a thread can be made to 
wait for some change, therefore avoiding the expensive polling and 
improving performance.

If any member knows what this may be, I would be very interested.
Regards, Ben Clewett.

I can't think of any way to do this efficiently without a trigger, a 
UDF, and a custom daemon. I assume based on your description that you have 
some sort of client application that needs to know if some data value 
has changed. However, you don't want to keep pinging the server to 
continuously ask has it changed yet, has it changed yet, has it changed 
yet...

Here's how I think you can make this work with some sort of efficiency. 
You need to setup your application to connect to a daemon on some server 
somewhere. The only purpose of this daemon is to broadcast to those 
clients who connect to it a message to the effect that some data has 
changed on the table you are interested in. If you wanted to get really 
fancy, the message could say what data changed and possibly what the new 
value is. That way your client could possibly act on the data without 
needing to poll the server.

How does the daemon know that data just changed? That's where the trigger 
and UDF come in. Triggers are fired during certain database events (adding 
records, changing records, or deleting records). I don't know for certain 
but I believe triggers can use UDFs in their code. The UDF that is called 
by the trigger detecting a change in the table you are interested in is 
what notifies the daemon (described earlier) that the data has changed. 
And, because the UDF is only called from within a trigger, you only bother 
the daemon when a change actually occurs.

The downside to this design is that triggers are not supported until 5.x 
(still in testing) so I don't know if you have that option. User-defined 
functions (UDFs) may be able to cover the job by themselves IF and only if 
you can control data changes to ALWAYS use your UDF. Otherwise some 
changes may slip through the cracks.

Anyway, that was my idea. Is there any other way for you to communicate a 
change in data than a passive detect like you are doing? How much 
control do you have over what can and cannot change your data 
(specifically the field you keep polling)? What other application-based 
options are open to you?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Getting error 136 during an update

2005-03-22 Thread CheHax
Hello there,

I am receiving Got error 136 from storage engine and I need some
light on this matter.

I have a table with 23,000,000 records and I want to update it with
datas from another one with the exact same amount of rows. The 2
tables can be linked by a primary key. Both tables are myISAM, and
have not other key than the primary one. The server is a test server,
on WinXP Pro.

I run an UPDATE, like this one :

UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3;

It actually updates 6 collumns but the problem does not seem to be here.

When I run this query, it runs for a bit and then I got : 
Got error 136 from storage engine

At first, I thought it would be the filesize limit of 2GB, but this
file size is not valid because I have a NTFS file system.

So I tried an update like that, just after my error :

UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 
2200;

And it worked fine !

And the next one too :
UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 
1800 and tbl1.PKEY = 2200;

So I am wondering where the problem comes from. It is an issue with
the maximum_join_size ? If so, why didn't I get the real
maximum_join_size error like it is described in the doc ?

Thank you for your help!

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Getting error 136 during an update

2005-03-22 Thread mel list_php
Hi,
error 136 = No more room in index file
so I suppose it's a problem with the size needed for your keys, maybe that 
will help:
http://dev.mysql.com/doc/mysql/en/key-space.html

HTH,
Melanie

From: CheHax [EMAIL PROTECTED]
Reply-To: CheHax [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Getting error 136 during an update
Date: Tue, 22 Mar 2005 11:31:06 +0100
Hello there,
I am receiving Got error 136 from storage engine and I need some
light on this matter.
I have a table with 23,000,000 records and I want to update it with
datas from another one with the exact same amount of rows. The 2
tables can be linked by a primary key. Both tables are myISAM, and
have not other key than the primary one. The server is a test server,
on WinXP Pro.
I run an UPDATE, like this one :
UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3;
It actually updates 6 collumns but the problem does not seem to be here.
When I run this query, it runs for a bit and then I got :
Got error 136 from storage engine
At first, I thought it would be the filesize limit of 2GB, but this
file size is not valid because I have a NTFS file system.
So I tried an update like that, just after my error :
UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 
2200;
And it worked fine !
And the next one too :
UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,
tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 
1800 and tbl1.PKEY = 2200;
So I am wondering where the problem comes from. It is an issue with
the maximum_join_size ? If so, why didn't I get the real
maximum_join_size error like it is described in the doc ?
Thank you for your help!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Can't connect to local MySQL server through socket

2005-03-22 Thread Philipp Snizek
Hi

according to Dr Google I'm not the first one to encounter this error
below.

SpamAssassin: invoked with 'spamd -D -q -u filter'

failed to load user (filter) scores from SQL database: SQL Error:
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13)

Thus, I cannot read SpamAssassin preferences from the database.

I checked for the sticky bit on mysql.sock. No change.
I added all in /var/lib/mysql/ to the 'daemon' group. No change.

I hope somebody here can help me. I'm pretty much lost with this.

Thanks
Philipp

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: functions md5, crypt

2005-03-22 Thread Gleb Paharenko
Hello.



See:

  http://dev.mysql.com/doc/mysql/en/encryption-functions.html





symbulos partners [EMAIL PROTECTED] wrote:

 Dear friends,

 

 where is the description of the functions md5 in the manual? where is the 

 description of the function crypt()?

 

 are there are good alternatives?



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Getting error 136 during an update

2005-03-22 Thread Gleb Paharenko
Hello.



The manual recommends to use ALTER TABLE to increase the MAX_ROWS and

AVG_ROW_LENGTH table options values. See:



  http://dev.mysql.com/doc/mysql/en/repair.html







  



CheHax [EMAIL PROTECTED] wrote:

 Hello there,

 

 I am receiving Got error 136 from storage engine and I need some

 light on this matter.

 

 I have a table with 23,000,000 records and I want to update it with

 datas from another one with the exact same amount of rows. The 2

 tables can be linked by a primary key. Both tables are myISAM, and

 have not other key than the primary one. The server is a test server,

 on WinXP Pro.

 

 I run an UPDATE, like this one :

 

 UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,

 tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3;

 

 It actually updates 6 collumns but the problem does not seem to be here.

 

 When I run this query, it runs for a bit and then I got : 

 Got error 136 from storage engine

 

 At first, I thought it would be the filesize limit of 2GB, but this

 file size is not valid because I have a NTFS file system.

 

 So I tried an update like that, just after my error :

 

 UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,

 tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 

 2200;

 

 And it worked fine !

 

 And the next one too :

 UPDATE tbl1 INNER JOIN tbl2 USING (PKEY) SET tbl1.NUM = tbl2.COL1,

 tbl1.ADRESSE = tbl2.COL2, tbl1.CITY = tbl2.COL3 WHERE tbl1.PKEY 

 1800 and tbl1.PKEY = 2200;

 

 So I am wondering where the problem comes from. It is an issue with

 the maximum_join_size ? If so, why didn't I get the real

 maximum_join_size error like it is described in the doc ?

 

 Thank you for your help!

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



again on encryption function, with bug 7846 question

2005-03-22 Thread symbulos partners
Dear friends,

thanks for the link to the dev manual page on encryption function.

Which encryption is more secure (strongest)
AES
DES
SHA
?

I would have said AES, but after reading the manual chapters on DES, SHA I am 
not s(ec)ure any more.

By the way, I did not understand if the bug 

http://bugs.mysql.com/bug.php?id=7846

has been fixed.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: again on encryption function, with bug 7846 question

2005-03-22 Thread Tom Crimmins

On Tuesday, March 22, 2005 07:15, symbulos partners wrote:

 Dear friends,
 
 thanks for the link to the dev manual page on encryption function.
 
 Which encryption is more secure (strongest)
 AES
 DES
 SHA
 ?

Are you using this for password storage or encrypting actual data? 
If you are using it for passwords, I would suggest using SHA1 or MD5 
since these are one-way hashing algorithims.

 I would have said AES, but after reading the manual chapters on DES,
 SHA I am not s(ec)ure any more.
 
 By the way, I did not understand if the bug
 
 http://bugs.mysql.com/bug.php?id=7846
 
 has been fixed.

-- 
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



SELECT rows from the previous business day

2005-03-22 Thread Stembridge, Michael
A table exists with id and datetime columns; I need to SELECT records from
the previous business day. I began with this: 

 

SELECT id FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(datetime) =1 

 

But if NOW() is a Monday, it pulls records from Sunday (there are none since
records are inserted M-F only).I thought of using something like this in
my WHERE clause: 

 

AND DAYOFWEEK(datetime) != 6

 

Though this doesn't seem like an operable solution (If I'm not mistaken this
would return 0 rows if no records were inserted on a Sunday).  

 

Does MySQL include a specifier for business day?   

 

Thank you, 

Michael 



Re: Data Standards on Database Export-Import

2005-03-22 Thread SGreen
Z X C V [EMAIL PROTECTED] wrote on 03/21/2005 08:32:24 PM:

 
 Hello,
 
 Are there any good rfcs or other documents that would assist in the 
 discussion I'm having with our organization's Oracle programmers in 
 regards the following:
 
 Oracle DB - MySQL
 
 They recommend:
 
 ~ col~col ~col~ col',~col
 
 NOTE::I placed the ' in for a reason.
 
 I am looking for:
 
 col,col,col,col\'\,,col
 
 Of course the non-Oracle system is being tasked as the problem in this 

 case for the abnormal data request.
 
 Any help on this would be appreciated.
 
 Rob.

Unfortunately I am not sure any document like you seek actually exists (at 
least not in any modern literature). There are many ways to move data from 
memory to media and the format of the data on the media is usually 
determined by a number of factors (type of data, type of media, is the 
data intended for human or machine use, etc.). So I am not sure there ARE 
any standards for database export formatting (I did a quick Google and 
didn't find any in the top 50 responses for the search: data export 
standard format CSV (see notes below))...

To be honest, the mysqlimport and LOAD DATA INFILE facilities should be 
flexible enough to read the tilde-delimited format that your Oracle guys 
want to give you. If not, you should be able to ask them to either create 
a tab-delimited or comma-delimited dump (both formats are so ancient as 
to be /de facto/ standards and should be something that Oracle can create 
without any difficulty). What you were asking for is a comma-delimited 
format but you need some extra escaping to make it more MySQL compatible. 
I think that the extra escaping is what's throwing a monkey-wrench into 
the export process.

One viable option is for you to write a quick converter that re-parses 
their tilde-delimited format into something properly escaped for MySQL. IF 
you write it correctly, your format converter should be able to process 
several megabytes of dumped data per second. Yes, it's a pain in the neck 
to take the extra conversion step but sometimes we DBA's have to assemble 
our own lemons before we get to make the lemonade. 

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Notes:
a non-normative description of the CSV format: 
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
An example data export screen, a custom delimiter of a tilde would 
reproduce the format you are being offered: 
http://www.jinfonet.com/manualpro/userguide/expt_txt.htm
Some export/import formats of various ecological data. Notice how many 
there are: http://gce-lter.marsci.uga.edu/lter/data/formats.htm
A proposed format for Thoughts exchange: 
http://www.ms.lt/importexport.html



Re: SELECT rows from the previous business day

2005-03-22 Thread Jigal van Hemert
A quick try:

In most cases you need results from yesterday, but for Sunday and Monday we
must correct extra for the weekend.

DAYOFWEEK() returns 1 for Sunday, 2 for Monday, etc., so we can use this to
make a correction value:

SET @COR = (DAYOFWEEK(NOW())  3) * DAYOFWEEK(NOW());
SELECT * FROM table WHERE `datetime`  CURDATE() - INTERVAL (1 + @COR) DAY
AND `datetime`  CURDATE() - INTERVAL @COR DAY;

This construction is index-friendly, because MySQL will reduce the
calculation to a constant before running the query. The result is a simple
col  constant expression which can make use of indexes if they are present.
Expressions such as TO_DAYS(`datetime`) (as suggested by you) will result in
a full table scan and slow down the query significantly.

If you consider Saturday as a business day you only need to make a
correction for Monday:

SET @COR = (DAYOFWEEK(NOW()) = 2);

Regards, Jigal.

- Original Message - 
From: Stembridge, Michael [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, March 22, 2005 4:30 PM
Subject: SELECT rows from the previous business day


 A table exists with id and datetime columns; I need to SELECT records from
 the previous business day. I began with this:



 SELECT id FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(datetime) =1



 But if NOW() is a Monday, it pulls records from Sunday (there are none
since
 records are inserted M-F only).I thought of using something like this
in
 my WHERE clause:



 AND DAYOFWEEK(datetime) != 6



 Though this doesn't seem like an operable solution (If I'm not mistaken
this
 would return 0 rows if no records were inserted on a Sunday).



 Does MySQL include a specifier for business day?



 Thank you,

 Michael



 !DSPAM:42403a4317126025714369!



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Convert historical dates from UTC

2005-03-22 Thread Mike Rykowski
Hello,
I have historical dates in datetime format and they are in UTC.  I'd like 
to convert them to localtime. Can this be done with mysql 3.23.22?  It 
looks like 4.1 can handle this, but I won't be upgrading in a while.

If not, does anyone know of a perl module that takes mysql formated 
datetime and does this?

TIA
-
Mike Rykowski
IT - Telecommunication and Network Services
(847) 467-7335
[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


mysqldump: Got errno 5 on write

2005-03-22 Thread Mihail Manolov
Have you seen this before:
mysqldump: Got errno 5 on write
I have started getting this error recently in my email box - the message is 
result of my daily backup cronjob.
Ideas?
rgrdz,
Mihail Manolov


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: SELECT rows from the previous business day

2005-03-22 Thread SGreen
Stembridge, Michael [EMAIL PROTECTED] wrote on 03/22/2005 10:30:50 
AM:

 A table exists with id and datetime columns; I need to SELECT records 
from
 the previous business day. I began with this: 
 
 
 
 SELECT id FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(datetime) =1 
 
 
 
 But if NOW() is a Monday, it pulls records from Sunday (there are none 
since
 records are inserted M-F only).I thought of using something like 
this in
 my WHERE clause: 
 
 
 
 AND DAYOFWEEK(datetime) != 6
 
 
 
 Though this doesn't seem like an operable solution (If I'm not mistaken 
this
 would return 0 rows if no records were inserted on a Sunday). 
 
 
 
 Does MySQL include a specifier for business day? 
 
 
 
 Thank you, 
 
 Michael 
 
Do a little pre-processing to get your target date. I am assuming a 5 
day workweek (M-F) and no holidays.

SET @TodaysDate = CURDATE();
SET @LastBusDayStart = IF(DAYOFWEEK(@TodaysDate)=1
, @TodaysDate - INTERVAL 2 DAY
, IF(DAYOFWEEK(@TodaysDate)=2
, @TodaysDate - INTERVAL 3 DAY
, @TodaysDate - INTERVAL 1 DAY
)
);

SET @LastBusDayEnd = @TodaysDate + INTERVAL 1 DAY;

Then your new, very fast (because you can use an index) query looks like:

SELECT id
FROM table
WHERE datetime_field = @LastBusDayStart and 
datetime_field  @LastBusDayEnd;

The 40 or 50 milliseconds it takes to compute the starting and ending 
dates in the SET clauses saves you insert huge quantity noun here of 
time because you move the calculation OUT of your query. The query only 
needs to evaluate against constant values and will not need to compute a 
date difference for each row as it would have had to do using your 
original query.

IF you are on a version of MySQL pre-3.23 then these calculations get a 
little more hairy but they are still possible.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



Re: Convert historical dates from UTC

2005-03-22 Thread SGreen
Mike Rykowski [EMAIL PROTECTED] wrote on 03/22/2005 11:12:41 AM:

 Hello,
 
 I have historical dates in datetime format and they are in UTC.  I'd 
like 
 to convert them to localtime. Can this be done with mysql 3.23.22?  It 
 looks like 4.1 can handle this, but I won't be upgrading in a while.
 
 If not, does anyone know of a perl module that takes mysql formated 
 datetime and does this?
 
 TIA
 -
 
 Mike Rykowski
 IT - Telecommunication and Network Services
 (847) 467-7335
 [EMAIL PROTECTED]
 
 
 

What do you mean by historical? Are we talking 20th century dates or 
something BCE?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Re: mysqldump: Got errno 5 on write

2005-03-22 Thread V. M. Brasseur
According to the output of perror:
perror 5
Error code   5:  I/O error
Are you having problems with your disk?  Maybe syncing or bad sectors or 
even something as simple as out of space?

Best of luck,
--V
Mihail Manolov wrote:
Have you seen this before:
mysqldump: Got errno 5 on write
I have started getting this error recently in my email box - the message 
is result of my daily backup cronjob.

Ideas?
rgrdz,
Mihail Manolov


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Convert historical dates from UTC

2005-03-22 Thread Mike Rykowski
At 10:28 AM 3/22/2005, [EMAIL PROTECTED] wrote:

What do you mean by historical? Are we talking 20th century dates or 
something BCE?
Dates that could be a couple of years old.
-
Mike Rykowski
IT - Telecommunication and Network Services
(847) 467-7335
[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: SELECT rows from the previous business day

2005-03-22 Thread Peter Brawley




Michael,

Someone on the list recently dave this quickie formula for computing
the no. of biz days::

 DATEDIFF(date2, date1) - (WEEK(date2) - WEEK(date1)) * 2

PB

-

Stembridge, Michael wrote:

  A table exists with id and datetime columns; I need to SELECT records from
the previous business day. I began with this: 

 

SELECT id FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(datetime) =1 

 

But if NOW() is a Monday, it pulls records from Sunday (there are none since
records are inserted M-F only).I thought of using something like this in
my WHERE clause: 

 

"AND DAYOFWEEK(datetime) != 6"

 

Though this doesn't seem like an operable solution (If I'm not mistaken this
would return 0 rows if no records were inserted on a Sunday).  

 

Does MySQL include a specifier for business day?   

 

Thank you, 

Michael 


  
  

No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005
  



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: SELECT rows from the previous business day

2005-03-22 Thread SGreen
One problem with that formula is that it fails if you wrap around from one 
year to the next. But as a quickie, it's good.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Peter Brawley [EMAIL PROTECTED] wrote on 03/22/2005 01:01:29 
PM:

 Michael,
 
 Someone on the list recently dave this quickie formula for computing
 the no. of biz days::
 
   DATEDIFF(date2, date1) - (WEEK(date2) - WEEK(date1)) * 2
 
 PB
 
 -
 
 Stembridge, Michael wrote: 
 A table exists with id and datetime columns; I need to SELECT records 
from
 the previous business day. I began with this: 
 
 
 
 SELECT id FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(datetime) =1 
 
 
 
 But if NOW() is a Monday, it pulls records from Sunday (there are none 
since
 records are inserted M-F only).I thought of using something like 
this in
 my WHERE clause: 
 
 
 
 AND DAYOFWEEK(datetime) != 6
 
 
 
 Though this doesn't seem like an operable solution (If I'm not mistaken 
this
 would return 0 rows if no records were inserted on a Sunday). 
 
 
 
 Does MySQL include a specifier for business day? 
 
 
 
 Thank you, 
 
 Michael 
 
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005
   No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Passing Arrays between pages

2005-03-22 Thread PartyPosters
Hello,
Please can someone tell me how you pass arrays between PHP pages.
I have tried something like this and have tried many variations of this but
nothing working yet ;


Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;

echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$testArray\;

Page2
echo $testArray[1];


Many Thanks.
Kaan.



RE: Passing Arrays between pages

2005-03-22 Thread Jay Blanchard
[snip]
Please can someone tell me how you pass arrays between PHP pages.
I have tried something like this and have tried many variations of this
but
nothing working yet ;

Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;

echo INPUT NAME = \kcompany[]\ TYPE = \hidden\
VALUE=\$testArray\;

Page2
echo $testArray[1];
[/snip]

Just in case you hadn't noticed, this is the MySQL list. You may want to
try one of the PHP mailing lists

http://www.php.net/mailinglists


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



remote connection problem

2005-03-22 Thread gerardo Villanueva
I have mysql version 4.0.15-nt in a server NT, I can
connecting with mysql localy, but when i try remote 
connection the error is:
Error Number 2003 Can't connect to MySQL server on
'IP' (10060)   .
I use mysql odbc 3.51 
Is necesary the file  my.cnf  in c:\my.cnf

Regards

Gerardo Campos  

_
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Passing Arrays between pages

2005-03-22 Thread Mike Johnson
From: PartyPosters [mailto:[EMAIL PROTECTED] 

 Hello,
 Please can someone tell me how you pass arrays between PHP pages.
 I have tried something like this and have tried many 
 variations of this but
 nothing working yet ;
 
 
 Page 1
 $testArray[0] =Apple;
 $testArray[1] =Banana;
 $testArray[2] =Peach;
 
 echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ 
 VALUE=\$testArray\;
 
 Page2
 echo $testArray[1];

This is more of a PHP question, and I'm sure you'll be admonished for
it, but I'll answer it anyway. Essentially, you need to construct the
array elements as their own hidden values.

echo INPUT NAME = \kcompany[]\ TYPE = \hidden\
VALUE=\Apple\;
echo INPUT NAME = \kcompany[]\ TYPE = \hidden\
VALUE=\Banana\;
echo INPUT NAME = \kcompany[]\ TYPE = \hidden\
VALUE=\Peach\;

At that point, if you call:

echo $kcompany[1];

after the form submit, you'll get Banana.

HTH!

-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: remote connection problem

2005-03-22 Thread J.R. Bullington
1) Are you running a firewall? If so, make sure that port 3306 is open.

2) Is your MySQL server is up and running?

3) Do you have the correct permissions to connect to the server via your
mysql.hosts table?

Just some thoughts.

J.R.

-Original Message-
From: gerardo Villanueva [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 22, 2005 4:43 PM
To: mysql@lists.mysql.com
Subject: remote connection problem

I have mysql version 4.0.15-nt in a server NT, I can connecting with mysql
localy, but when i try remote connection the error is:
Error Number 2003 Can't connect to MySQL server on 'IP' (10060)   .
I use mysql odbc 3.51
Is necesary the file  my.cnf  in c:\my.cnf

Regards

Gerardo Campos  

_
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



smime.p7s
Description: S/MIME cryptographic signature


RE: remote connection problem

2005-03-22 Thread J.R. Bullington
When you are running as root, but are you running as 'root'@'%' or
'root'@'localhost'? This does make a big difference. The '%' means all
network connections, which isn't secure. I would only using it as testing
purposes. 

However, because your error message says that you cannot see the server, are
you sure that your remote connection can see the NT server? This may be a
bigger problem, i.e. DNS or IP routing/access lists.

You may also want to check the hostname.err logs on the MySQL server to
see if there is a connection problem there.

J.R.

-Original Message-
From: gerardo Villanueva [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 22, 2005 5:03 PM
To: [EMAIL PROTECTED]
Subject: RE: remote connection problem

1.- Yes I have a firewall but the port 3306 is open
2.- Mysql is running in the server
3.- I connecting with  user root and his has all the permissions

I try to remote connection  to my server NT 4.0 , mysql run there. 

Gerardo Campos







 

_
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com


smime.p7s
Description: S/MIME cryptographic signature


Re: remote connection problem

2005-03-22 Thread Michael Kruckenberg
One other thing to check, make sure --skip-networking isn't specified in
your configuration.

mysql show variables like 'skip_networking';
+-+---+
| Variable_name   | Value |
+-+---+
| skip_networking | OFF   |
+-+---+
1 row in set (0.00 sec)

If the value is ON, you won't be allowed to make connections to the
server via TCP/IP.

On Tue, 2005-03-22 at 15:43 -0600, gerardo Villanueva wrote:
 I have mysql version 4.0.15-nt in a server NT, I can
 connecting with mysql localy, but when i try remote 
 connection the error is:
 Error Number 2003 Can't connect to MySQL server on
 'IP' (10060)   .
 I use mysql odbc 3.51 
 Is necesary the file  my.cnf  in c:\my.cnf
 
 Regards
 
 Gerardo Campos  
 
 _
 Do You Yahoo!?
 Informacin de Estados Unidos y Amrica Latina, en Yahoo! Noticias.
 Vistanos en http://noticias.espanol.yahoo.com
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: remote connection problem

2005-03-22 Thread Michael Kruckenberg
Not necessary to change my.cnf, unless --skip-networking was specified.
Also assuming that you are using port 3306.

mysql show variables like 'port';
+---+---+
| Variable_name | Value |
+---+---+
| port  | 3306  |
+---+---+
1 row in set (0.00 sec)

Can you verify that network traffic is getting from your remote client
to the MySQL server? When you attempt to connect, do you see network
packets coming to port 3306 on the MySQL server machine? 

On Tue, 2005-03-22 at 16:35 -0600, gerardo Villanueva wrote:
 I execute your query  and
 the skip_networking is OFF. 
 the file my.cnf, have to ubicated in C:\my.cnf or is
 not
 necesary??
 
 Regards
 
 Gerardo Campos
 
 _
 Do You Yahoo!?
 Informacin de Estados Unidos y Amrica Latina, en Yahoo! Noticias.
 Vistanos en http://noticias.espanol.yahoo.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Passing Arrays between pages

2005-03-22 Thread Peter Brawley




Or you can issue session_start() at the top of each page, assign your
array to $_SESSION[] in one page, and pluck it from the session array
in the other page.

(But you asked the question in the wrong forum)

PB

-

Mike Johnson wrote:

  From: PartyPosters [mailto:[EMAIL PROTECTED]] 

  
  
Hello,
Please can someone tell me how you pass arrays between PHP pages.
I have tried something like this and have tried many 
variations of this but
nothing working yet ;


Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;

echo "INPUT NAME = \"kcompany[]\" TYPE = \"hidden\" 
VALUE=\"$testArray\"";

Page2
echo $testArray[1];

  
  
This is more of a PHP question, and I'm sure you'll be admonished for
it, but I'll answer it anyway. Essentially, you need to construct the
array elements as their own hidden values.

echo "INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Apple\"";
echo "INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Banana\"";
echo "INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Peach\"";

At that point, if you call:

echo $kcompany[1];

after the form submit, you'll get Banana.

HTH!

  



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Passing Arrays between pages

2005-03-22 Thread Steve Davies
Hi Kaan
try
Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;
$testA=implode(!, $testArray);
echo INPUT NAME = \kcompany\ TYPE = \hidden\ VALUE=\$testA\;
Page2
$testArray=explode(!, $kcompany);
echo $testArray[1];
HTH
Steve


PartyPosters wrote:
Hello,
Please can someone tell me how you pass arrays between PHP pages.
I have tried something like this and have tried many variations of this but
nothing working yet ;
Page 1
$testArray[0] =Apple;
$testArray[1] =Banana;
$testArray[2] =Peach;
echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$testArray\;
Page2
echo $testArray[1];
Many Thanks.
Kaan.
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


How to import data from Dbase3?

2005-03-22 Thread BG Mahesh

hi

How do I import data from Dbase3 into MySQL?

--
B.G. Mahesh
[EMAIL PROTECTED]
http://www.indiainfo.com/

-- 
__
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com 
Check out our value-added Premium features, such as an extra 20MB for mail 
storage, POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to import data from Dbase3?

2005-03-22 Thread Ehrwin Mina
BG Mahesh wrote:
hi
How do I import data from Dbase3 into MySQL?
--
B.G. Mahesh
[EMAIL PROTECTED]
http://www.indiainfo.com/
 

BG,
There are tools you can use to migrate it to mysql, i use it before that 
i get it in the forum. You can search some forum indicating the 
migration tools for DB3, Foxpro, access.

thanks,
--
*Ehrwin C. Mina*
*/Chikka Asia, Inc. /*
*9/F RCBC Plaza Tower 2
6819 Ayala Avenue
Makati City, Philippines
hp1: +639189304383
hp2: +639178452102*
*tel: +63-2-757-2630
fax: +63-2-757-2633
email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
*URL: **http://www.chikka.com* mailto:[EMAIL PROTECTED]
*This message and any attachment are confidential and may be privileged 
or otherwise protected from disclosure. If you are not the intended 
recipient, you must not copy this message or attachment or disclose the 
contents to any other person. If you have received this transmission in 
error, please notify the sender immediately and delete the message and 
any attachment from your system. Chikka does not accept liability for 
any omissions or errors in this message which may arise as a result of 
E-Mail-transmission or for damages resulting from any unauthorized 
changes of the content of this message and any attachment thereto. 
Chikka does not guarantee that this message is free of viruses and does 
not accept liability for any damages caused by any virus transmitted 
therewith.*

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]