Re: View image from browser

2002-12-27 Thread Paul DuBois
At 23:23 -0800 12/26/02, tan tan wrote:

Hi,

Is anyone know how to view image that is stored in
mysql as binary format to
a browser ?

Thank you.


Once you pull your image data from MySQL (I assume you're using some
kind of script for this), then you do this the same way you'd do it
if MySQL weren't involved.  Send your HTTP headers to indicate the
MIME type and the length, a blank line, and the image data.

If you want some example code in Perl, get the webdb distribution at
http://www.kitebird.com/mysql-perl/ and look in the distribution's
image directory.


sql, query

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread tan tan
Hi Paul
I went to the site and I can't look for the page.
If you dont' mind to get the the exact url.
Thanks.

--- Paul DuBois [EMAIL PROTECTED] wrote:
 At 23:23 -0800 12/26/02, tan tan wrote:
 Hi,
 
 Is anyone know how to view image that is stored in
 mysql as binary format to
 a browser ?
 
 Thank you.
 
 Once you pull your image data from MySQL (I assume
 you're using some
 kind of script for this), then you do this the same
 way you'd do it
 if MySQL weren't involved.  Send your HTTP headers
 to indicate the
 MIME type and the length, a blank line, and the
 image data.
 
 If you want some example code in Perl, get the webdb
 distribution at
 http://www.kitebird.com/mysql-perl/ and look in the
 distribution's
 image directory.
 
 
 sql, query


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




'Docs/mysqld_error.txt'

2002-12-27 Thread Vicente Valero
Segun el manual de mysql, en los archivos de distribución debe existir un
txt 'Docs/mysqld_error.txt' con un detalle de la lista de mensajes de error.
En mis archivos de distribución no he sido capaz de hallar dicho fichero.
Alguien que lo tenga seria tan amable de enviarmelo?

Gracias

___
Yahoo! Sorteos
Consulta si tu número ha sido premiado en
Yahoo! Sorteos http://loteria.yahoo.es

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




ashok, from cusat

2002-12-27 Thread ashok kumar patel
Sir,

I am facing problem in one function , actually in my table 
there is two field: id, and password and I am checking the id 
field for any user who is added to the friendlist of another user, 
like in yahoo messenger.

MYSQL *conn;
MYSQL_RES *res_ptr;
MYSQL_ROW sqlrow;
FILE *fp;
/**/

int Friend_Result()
{
unsigned int i; int rows;

while( (sqlrow = mysql_fetch_row(res_ptr)) != NULL)
{

	for(i = 0; i  mysql_num_fields(res_ptr); i++)
	{
	if(i  0) printf(\t);

	if(sqlrow[i] != NULL) printf(%s, sqlrow[i]);
	else printf(%s, NULL);
	}
	printf(\n);
}
if(mysql_errno(conn) != 0)
{
	printf(mysql_fetch_row error\n);
	return 0;
}
if((unsigned long)mysql_num_rows(res_ptr) == 0)
{

  	printf(Invalid  Not have a valid TARA ID...\n);
	return 0;
}
return 1;
}
/**/

int Check_Exist_Friend(char *f)
{
char buf[200];
int result, rows;

printf( Friend = %s\n, f);
strcpy(buf, SELECT id from tara_user where id = );
strcat(buf, ');
strcat(buf, f);
strcat(buf, ');

result = mysql_query(conn, buf);

res_ptr = mysql_store_result(conn);

if(res_ptr == NULL) printf(Storing Error\n);
else
{
	printf(Res_ptr is not null\n);
	if(! Friend_Result() ) return 0;
mysql_free_result(res_ptr);
}
return 1;
}

/*  CHECK THE FRIEND - ID IN DATABASE ***/

void Add_New_Friend(char *a, char *gp, char *f, int sd)
{
int result;
char buf[200];

printf(Friend name = %s\n, f);
if(! Check_Exist_Friend(f) )  return;
else
{
	strcpy(buf, INSERT INTO flist values();
	strcat(buf, ');
	strcat(buf, a);
	strcat(buf, ');
	strcat(buf, ,);
	strcat(buf, ');
	strcat(buf, gp);
	strcat(buf, ');
	strcat(buf, ,);
	strcat(buf, ');
	strcat(buf, f);
	strcat(buf,');
	strcat(buf,));

	result = mysql_query(conn, buf);

	if(!result) printf(Inserted %lu rows\n,
			   (unsigned long)mysql_affected_rows(conn));
	else fprintf(stderr, Insert error %d: %s\n, 
mysql_errno(conn),
		mysql_error(conn));
}
}

   I am calling function Check_Exist_Friend(f) from 
Add_New_Friend() but each time where the friend name is existing 
in the table or not it give me the same result.  I have tried a 
lot but couldn't succeed.
I don't know where is fault , so please reply me . so that I 
can do my rest of work.

   If there are other option to check the existence of any user 
whether the user is present or not , please let me know

   Hoping positive response from your side.

   Thanking you

ASHOK KUMAR
M.C.A. 5TH SEM.
COCHIN UNIVERSITY OF SCIENCE AND TECHNOLOGY
KOCHI : 682 022, KERALA (INDIA).


 NIIT supports World Computer Literacy Day on 2nd December.
 Enroll for NIIT SWIFT Jyoti till 2nd December for only Rs. 749
 and get free Indian Languages Office software worth Rs. 2500.
 For details contact your nearest NIIT centre, SWIFT Point
 or click here http://swift.rediff.com/




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: php3.0.15

2002-12-27 Thread B. van Ouwerkerk
This is a PHP question.

Visit:
http://www.php.net/manual/en/function.mysql-connect.php
for more information about the function mysql_connect.

Or:
http://www.php.net/links.php
To find some tutorials to get you going.

You really should upgrade to a newer release of PHP.

Have fun,


B.




-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 27 december 2002 7:43
Aan: [EMAIL PROTECTED]
Onderwerp: php3.0.15


oY!

I am running RH 6.2 with PHP 3.0.15 (don't ask why I do not run php 4 yet, I
really need to install theses versions to start everything) but when I am
trying to access a mysql function I get the following error : Fatal error:
Call to unsupported or undefined function mysql_connect() in
/home/httpd/html/test/index.php3 on line 9

And my line #9 is : mysql_connect ( ... );

What I forgot during the installation ?

P.S. : I already try dl(mysql.so); at the begining of my pages, not able
to load the library!




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RES: Integration

2002-12-27 Thread Micheline Carvalho Barroso Pereira - DATAPREVPB
What I really want is to replicate data from a database (MySQL) into another
(MS SQL Server).

- Mensagem original -
De: Kevin Wise [SMTP:[EMAIL PROTECTED]]
Enviada em: quinta-feira, 26 de dezembro de 2002 19:43
Para:   Micheline Carvalho Barroso Pereira - DATAPREVPB
Assunto:Re: Integration

Acho que voce deve explicar o que queria fazer.  

What do you really mean by 'integrating'. ?

- Original Message -
From: Micheline Carvalho Barroso Pereira - DATAPREVPB 
[EMAIL PROTECTED]
Date: Thursday, December 26, 2002 12:12 pm
Subject: Integration

 Does anyone know how to integrate easily MySql tables with 
 Microsoft SQL
 Server tables?
 
 Thanks in advance,
 
 Micheline.
 

---
 --
 Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail
[EMAIL PROTECTED]
 To unsubscribe, e-mail mysql-unsubscribe-
 [EMAIL PROTECTED]Trouble unsubscribing? Try: 
 http://lists.mysql.com/php/unsubscribe.php
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread Solid Plasma (slpl)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello tan,

Friday, December 27, 2002, 8:43:25 AM, you wrote:

 Hi Paul
 I went to the site and I can't look for the page.
 If you dont' mind to get the the exact url.
 Thanks.

 you don't find it because it's an pdf file
http://www.kitebird.com/mysql-perl/ch05.pdf
and do a search in the pdf file for the
string 'Storing and Retrieving Images'

 --- Paul DuBois [EMAIL PROTECTED] wrote:
 At 23:23 -0800 12/26/02, tan tan wrote:
 Hi,
 
 Is anyone know how to view image that is stored in
 mysql as binary format to
 a browser ?
 
 Thank you.

 Once you pull your image data from MySQL (I assume
 you're using some
 kind of script for this), then you do this the same
 way you'd do it
 if MySQL weren't involved.  Send your HTTP headers
 to indicate the
 MIME type and the length, a blank line, and the
 image data.

 If you want some example code in Perl, get the webdb
 distribution at
 http://www.kitebird.com/mysql-perl/ and look in the
 distribution's
 image directory.


 sql, query

- --
Best regards,
 Solidmailto:[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)

iD8DBQE+DEE02PEgI0nAJngRAla8AJ9qbLE2qAgOdTHYmrvP2liTYNUpnwCgr47s
H/O5+Zh87YH1VbJ1Fst6R0Q=
=LEV7
-END PGP SIGNATURE-


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




birthday calculation problem

2002-12-27 Thread Patrascu Eugeniu
Hi,

I have a problem calculating birthdays in sql. Here goes my setup:

I have a database that contains the bithdays of a number of people, and 
I want to know when there birthday is to congratulate them.
The thing is that I want to now that a day before their birthday. 
Therefore I need a way to do that, and I do not know how to do it, so I 
am asking on this list, maybe there is someone that can tell me how.


Regards,

Patrascu Eugeniu










-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: MySQL/InnoDB-4.0.7 is released

2002-12-27 Thread Heikki Tuuri
Hi!

Buildmaster Lenz Grimmer of MySQL AB informed me that the last changeset in
4.0.7 was from Dec 20th, 2002.

That means that InnoDB-4.0.7 is essentially the same as InnoDB-4.0.6, and
the changes listed below will only appear in MySQL-4.0.8!

I apologize for the confusion. It was my error not to check the exact date
of the source tree snapshot in 4.0.7.

Despite this confusion, I wish a prosperous New Year to all MySQL/InnoDB
users!

Heikki Tuuri
Innobase Oy
http://www.innodb.com


- Original Message -
From: Heikki Tuuri [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Thursday, December 26, 2002 11:04 PM
Subject: MySQL/InnoDB-4.0.7 is released


 Hi!

 InnoDB is a MySQL table type which offers transactions, row level locking,
 foreign key constraints, and a non-free hot backup tool.

 InnoDB is included in MySQL-Max-3.23 and all MySQL-4.0 downloads available
 at http://www.mysql.com.

 MySQL AB decided to release MySQL-4.0.7 just a week after 4.0.6 to fix a
 security issue in mysql_drop_db() in 4.0.

 InnoDB in 4.0.7 allows a user to define for a FOREIGN KEY constraints also
 ON UPDATE actions. This new feature has been requested by several users
 during the past year.

 As a special Christmas present you now have 4 % more free space in your
 tablespace to use for storage of tables and indexes. That is possible
 because the free space margin in InnoDB was reduced from 5 % to 1 % of the
 tablespace size. No conversion of tables is needed. You get the bonus
space
 simply by upgrading to 4.0.7.


 Full changelog:

 * InnoDB now supports also the SQL syntax FOREIGN KEY (...) REFERENCES
 ...(...) [ON UPDATE CASCADE | ON UPDATE SET NULL | ON UPDATE RESTRICT | ON
 UPDATE NO ACTION].

 * Tables and indexes now reserve 4 % less space in the tablespace. Also
 existing tables reserve less space. By upgrading to 4.0.7 you will see
more
 free space in InnoDB free in SHOW TABLE STATUS.

 * Fixed bugs: updating the PRIMARY KEY of a row would generate a foreign
key
 error on all FOREIGN KEYs which referenced secondary keys of the row to be
 updated. Also, if a referencing FOREIGN KEY constraint only referenced the
 first columns in an index, and there were more columns in that index,
 updating the additional columns generated a foreign key error.

 * Fixed a bug: if an index contains some column twice, and that column is
 updated, the table will become corrupt. From now on InnoDB prevents
creation
 of such indexes.

 * Fixed a bug: removed superfluous error 149 and and 150 printouts from
the
 .err log when a locking SELECT caused a deadlock or a lock wait timeout.


 I wish a prosperous New Year to all MySQL/InnoDB users!

 Heikki Tuuri
 Innobase Oy
 http://www.innodb.com




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread Paul DuBois
At 0:43 -0800 12/27/02, tan tan wrote:

Hi Paul
I went to the site and I can't look for the page.
If you dont' mind to get the the exact url.
Thanks.


Odd.  Anyone else out there have trouble with that URL?

http://www.kitebird.com/mysql-perl/downloads.php
http://www.kitebird.com/mysql-perl/webdb/webdb.tar.gz
http://www.kitebird.com/mysql-perl/webdb/webdb.zip



--- Paul DuBois [EMAIL PROTECTED] wrote:

 At 23:23 -0800 12/26/02, tan tan wrote:
 Hi,
 
 Is anyone know how to view image that is stored in
 mysql as binary format to
 a browser ?
 
 Thank you.

 Once you pull your image data from MySQL (I assume
 you're using some
 kind of script for this), then you do this the same
 way you'd do it
 if MySQL weren't involved.  Send your HTTP headers
 to indicate the
 MIME type and the length, a blank line, and the
 image data.

 If you want some example code in Perl, get the webdb
 distribution at

  http://www.kitebird.com/mysql-perl/ and look in the

 distribution's
 image directory.



  sql, query



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: birthday calculation problem

2002-12-27 Thread George Chelidze
Not tested. You should have table dates with columns email and 
birthday. birthday is in format 27 December

#!/bin/sh
dbname=birthday
dbhost=localhost
dbuser=alpha
dbpass=beta

persons=`mysql -h$dbhost -u$dbuser -p$dbpass $dbname --execute=select 
email from dates where date_format(adddate(now(), interval 1 day), \%d 
%M\) = birthday  | grep -v ^date_format`

if [ $persons !=  ]; then
   echo $persons | while read email; do
   echo Wish you all the best | /bin/mail -s Happy Birthday 
$email
   done
fi


regards,


Patrascu Eugeniu wrote:

Hi,

I have a problem calculating birthdays in sql. Here goes my setup:

I have a database that contains the bithdays of a number of people, 
and I want to know when there birthday is to congratulate them.
The thing is that I want to now that a day before their birthday. 
Therefore I need a way to do that, and I do not know how to do it, so 
I am asking on this list, maybe there is someone that can tell me how.


Regards,

Patrascu Eugeniu










-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




--
George Chelidze






-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Decimal and LOAD DATA

2002-12-27 Thread Jonas C. Voss
Hi all,

I have a text-file containing products and their prices for a small 
shop. I upload and insert the text-file into a MySQL table using the 
LOAD DATA LOCAL INFILE command, and it really works a treat.

My problem is that when inserting prices of more than one thousand, the 
field it gets inserted into formats it wrong. Ex:

The field price is of type decimal(13,2), inserting via LOAD DATA 
etc. formats the price 1.139,00 to 1.13. I figured it had to do with 
different delimiters of thousands and hundreds (the text-file uses 
danish delimiters), so I cleaned up the file with PHP replacing the . 
with a , in prices above 1000, and vice versa.

This doesn't seem to fix the problem though. I can tell that the 
replacing of ,'s and .'s is successfull (because I print the resulting 
output to the screen), but MySQL still interprets the number as 1.13, 
and not as 1.139,00 or 1,139.00 (yes, I tried both).

Actually, I tried a plethora of formats including the following:

1139
113900
1.139,00
1,139.00
1139,00
1139.00

But MySQL interprets them all as 1.13.

Inserting '1139' via CLI or phpMyAdmin works as expected, I get a price 
of '1139.00'.

Is this an issue anybody dealt with before? I'd be happy to hear your 
findings on the matter.

The code I wrote for importing the text-file can be found here:

http://xslt.it-c.dk/~jcv/usenet/tusindfryd.phps

The echo's are in danish, but you'll get the point of the script, 
hopefully.

All thoughts on this appreciated.

Thanks.

specs:
MySQL 3.23.53a-Max
RH 7.3

--
// Jonas C. Voss // http://verture.net/ //


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Connecting to remote MySQL-DB using VBMyQL 

2002-12-27 Thread Peter Simard
9:15 AM
Friday
12/27/2002


I'm  trying  to connect an VB-6.0 application to a remote MysQL DB and
am  running  into  difficulty.  In particular I get an: 'Runtime error
3709':  Connection  cannot  be  used  to  perform operation. It may be
closed  or invalid in this context.' I'm certain the connection string
for opening the recordset is the problem, however, I've been unable to
configure a string that will connect to the remote server..

The code is posted here:

http://www.vbcity.com/forums/topic.asp?tid=16917

  

--
Pete
908.630.9411   
mailto:[EMAIL PROTECTED]



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: What does this mean? : Warning: thr_alarm queue is full

2002-12-27 Thread Stefan Hinz, iConnect \(Berlin\)
Chung,

  Warning: thr_alarm queue is full
  What's this? Is it serious problem?

Looking for thr_alarm in the MySQL Manual, I find this:

If mysqld is compiled with -DUSE_ALARM_THREAD, a dedicated thread that
handles alarms is created.  This is only used on some systems where
there are problems with sigwait() or if one wants to use the thr_alarm()
code in ones application without a dedicated signal handling thread.

Link to this manual part: http://www.mysql.com/doc/en/MySQL_threads.html

So, I guess all it means is that the thr_alarm queue is full ;-)

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschaftsfuhrer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Chung Ha-nyung [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 27, 2002 3:49 AM
Subject: What does this mean? : Warning: thr_alarm queue is full


 query.

   I happened to find out that the lots of following error messages are
 stored
 error log file:
  Warning: thr_alarm queue is full

  What's this? Is it serious problem?


 --
  Chung Ha-nyung alita@[neowiz.com|kldp.org]
  Sayclub http://www.sayclub.com
  NeoWiz http://www.neowiz.com



 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread Doug Thompson
On Fri, 27 Dec 2002 07:15:01 -0600, Paul DuBois wrote:

At 0:43 -0800 12/27/02, tan tan wrote:
Hi Paul
I went to the site and I can't look for the page.
If you dont' mind to get the the exact url.
Thanks.

Odd.  Anyone else out there have trouble with that URL?

http://www.kitebird.com/mysql-perl/downloads.php
http://www.kitebird.com/mysql-perl/webdb/webdb.tar.gz
http://www.kitebird.com/mysql-perl/webdb/webdb.zip



They work fine from here.




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




problem to stop mysql under windows xp

2002-12-27 Thread Massimo Petrini
Since 4.03 version under windows XP with SP1  (today I am using 4.0.7
max-nt) , on a slave host, when I stopped the service Mysql, via MYSQLADMIN
the semaphore became yellow instead red. The only solution is shutdown the
pc.  Also when I run the command  slave stop the process hang and not became
in stop (you cannot have the prompt command).

Do you know this problem ?
Tks in advance
-
Massimo Petrini
c/o Omt spa
Via Ferrero 67/a
10090 Cascine Vica (TO)
Tel.+39 011 9505334
Fax +39 011 9575474
E-mail  [EMAIL PROTECTED]



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread tan tan
Hi,
Sorry I didn't check in the pdf. Thanks guys.
By the way, I found there is an article from
www.onlamp.com/lpt/a/a370 it uses the php to do the
same thing.
Thanks once again.
Tan Tan

--- Paul DuBois [EMAIL PROTECTED] wrote:
 At 0:43 -0800 12/27/02, tan tan wrote:
 Hi Paul
 I went to the site and I can't look for the page.
 If you dont' mind to get the the exact url.
 Thanks.
 
 Odd.  Anyone else out there have trouble with that
 URL?
 
 http://www.kitebird.com/mysql-perl/downloads.php

http://www.kitebird.com/mysql-perl/webdb/webdb.tar.gz
 http://www.kitebird.com/mysql-perl/webdb/webdb.zip
 
 
 --- Paul DuBois [EMAIL PROTECTED] wrote:
   At 23:23 -0800 12/26/02, tan tan wrote:
   Hi,
   
   Is anyone know how to view image that is stored
 in
   mysql as binary format to
   a browser ?
   
   Thank you.
 
   Once you pull your image data from MySQL (I
 assume
   you're using some
   kind of script for this), then you do this the
 same
   way you'd do it
   if MySQL weren't involved.  Send your HTTP
 headers
   to indicate the
   MIME type and the length, a blank line, and the
   image data.
 
   If you want some example code in Perl, get the
 webdb
   distribution at
http://www.kitebird.com/mysql-perl/ and look in
 the
   distribution's
   image directory.
 
 
sql, query
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Decimal and LOAD DATA

2002-12-27 Thread Paul DuBois
At 15:18 +0100 12/27/02, Jonas C. Voss wrote:

Hi all,

I have a text-file containing products and their prices for a small 
shop. I upload and insert the text-file into a MySQL table using the 
LOAD DATA LOCAL INFILE command, and it really works a treat.

My problem is that when inserting prices of more than one thousand, 
the field it gets inserted into formats it wrong. Ex:

The field price is of type decimal(13,2), inserting via LOAD DATA 
etc. formats the price 1.139,00 to 1.13. I figured it had to do with 
different delimiters of thousands and hundreds (the text-file uses 
danish delimiters), so I cleaned up the file with PHP replacing the 
. with a , in prices above 1000, and vice versa.

This doesn't seem to fix the problem though. I can tell that the 
replacing of ,'s and .'s is successfull (because I print the 
resulting output to the screen), but MySQL still interprets the 
number as 1.13, and not as 1.139,00 or 1,139.00 (yes, I tried both).

Actually, I tried a plethora of formats including the following:

1139
113900
1.139,00
1,139.00
1139,00
1139.00

But MySQL interprets them all as 1.13.

Based on that last statement, it sounds as though you're still loading
the original file and not the transformed version.  There is no way that
MySQL will interpret *all* those values as 1.13.

In any case, the values you end up loading should use '.' for the decimal
point, and should not contain any commas at all.



Inserting '1139' via CLI or phpMyAdmin works as expected, I get a 
price of '1139.00'.

Is this an issue anybody dealt with before? I'd be happy to hear 
your findings on the matter.

The code I wrote for importing the text-file can be found here:

http://xslt.it-c.dk/~jcv/usenet/tusindfryd.phps

Looks like you upload a file to $upload_file, transform its contents
to $cleaned_file, and then attempt to use LOAD DATA with ... $upload_file!
(rather than the transformed file).



The echo's are in danish, but you'll get the point of the script, hopefully.

All thoughts on this appreciated.

Thanks.

specs:
MySQL 3.23.53a-Max
RH 7.3

--
// Jonas C. Voss // http://verture.net/ //



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Trouble converting Access SQL to MySQL

2002-12-27 Thread Asendorf, John
I'm attempting to convert an application from ASP/Access to PHP/MySQL  My
problem is in the SQL conversion.

The SQL determines distance between two zip codes:

This is the Access original:

SELECT Dealers.*, ((2285-Zips.North)^2+(4760-Zips.West)^2)^.5 AS Distance
FROM Dealers INNER JOIN Zips ON Dealers.Zip = Zips.Zip ORDER BY
(2285-Zips.North)^2+(4760-Zips.West)^2

The numbers in the calculations (such as the 2285 and 4760) are brought in
from the Zips table prior to this piece of SQL being sent.  I've tried a
number of things (breaking it down into smaller chunks, changing ON to
USING, etc.) but don't seem to be able to make the calculation work in the
SQL.

Any help here?  Please reply to me since I only *subscribe* to the Win32
MySQL list.

Thanks, John




-
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit

-
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Decimal and LOAD DATA

2002-12-27 Thread Jonas C. Voss
On fredag, dec 27, 2002, at 16:19 Europe/Copenhagen, Paul DuBois wrote:


At 15:18 +0100 12/27/02, Jonas C. Voss wrote:


Actually, I tried a plethora of formats including the following:

1139
113900
1.139,00
1,139.00
1139,00
1139.00

But MySQL interprets them all as 1.13.


Based on that last statement, it sounds as though you're still loading
the original file and not the transformed version.  There is no way 
that
MySQL will interpret *all* those values as 1.13.

In any case, the values you end up loading should use '.' for the 
decimal
point, and should not contain any commas at all.

Ok, thanks.


Inserting '1139' via CLI or phpMyAdmin works as expected, I get a 
price of '1139.00'.
Is this an issue anybody dealt with before? I'd be happy to hear your 
findings on the matter.
The code I wrote for importing the text-file can be found here:
http://xslt.it-c.dk/~jcv/usenet/tusindfryd.phps

Looks like you upload a file to $upload_file, transform its contents
to $cleaned_file, and then attempt to use LOAD DATA with ... 
$upload_file!
(rather than the transformed file).

Blast, you are right! Well, sort of. I replace the content of 
$uploadfile with $cleaned_file here:

# truncates the file pointer:
ftruncate($fd,0);

# writes content of $cleaned_file to file pointer $fd:
fwrite($fd, $cleaned_file);

But, I didn't put a + in my file pointer, so the file was only 
readable, not writeable, see?

$fd = fopen ($uploadfile, r);

Egad I feel stupid. Thanks for pointing me in the right direction, it 
works perfectly now. :)

--
// Jonas C. Voss // http://verture.net/ //


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: birthday calculation problem

2002-12-27 Thread Gelu Gogancea
Hi,
I think you can try to use TO_DAYS() function;
eg:
select TO_DAYS('2002-12-28')-TO_DAYS(NOW());

Regards,

Gelu
_
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
  [EMAIL PROTECTED]
- Original Message -
From: Patrascu Eugeniu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 27, 2002 2:56 PM
Subject: birthday calculation problem


 Hi,

 I have a problem calculating birthdays in sql. Here goes my setup:

 I have a database that contains the bithdays of a number of people, and
 I want to know when there birthday is to congratulate them.
 The thing is that I want to now that a day before their birthday.
 Therefore I need a way to do that, and I do not know how to do it, so I
 am asking on this list, maybe there is someone that can tell me how.


 Regards,

 Patrascu Eugeniu










 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: [patch] Error in Makefile prevents complete distclean

2002-12-27 Thread Lenz Grimmer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

On Sun, 22 Dec 2002 [EMAIL PROTECTED] wrote:

 Description:
   The unpacked source differs from the source tree after a
   ./configure  make  make distclean. This should be considered
   as Makefile bug, as e.g. package maintainers like me depends on
   a souce that cleans up it self so that we can easyly produce diffs
   containing only our own modifications.
 How-To-Repeat:
   ./configure  make  make clean; diff -u --recursive ../orig .
 Fix:

 Some diffs:

 #
 # Cleans up the vio_* and ctype-* symlinks that are created by link_source
 #
 $ diff -u mysql-dfsg-4.0.6.gamma.orig/libmysql/Makefile.shared 
mysql-dfsg-4.0.6.gamma/libmysql/Makefile.shared
 --- mysql-dfsg-4.0.6.gamma.orig/libmysql/Makefile.shared2002-12-16 
10:11:57.0 +0100
 +++ mysql-dfsg-4.0.6.gamma/libmysql/Makefile.shared 2002-12-21 
01:56:07.0 +0100
 @@ -84,6 +84,8 @@
 rm -f `echo $(mystringsobjects) | sed s;\.lo;.c;g` \
   `echo $(dbugobjects) | sed s;\.lo;.c;g` \
   `echo $(mysysobjects) | sed s;\.lo;.c;g` \
 + `echo $(vio_objects) | sed s;\.lo;.c;g` \
 +  $(CHARSET_SRCS) $(CHARSET_OBJS) \
$(mystringsextra) $(mystringsgen) $(mysysheaders) \
ctype_extra_sources.c net.c ../linked_client_sources

 There are some others.. maybe I search them later.

Thanks, I applied this one to the 3.23 tree now - Monty will merge it into
4.0 at some point.

Bye,
LenZ
- -- 
For technical support contracts, visit https://order.mysql.com/?ref=mlgr
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /  Mr. Lenz Grimmer [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Production Engineer
/_/  /_/\_, /___/\___\_\___/ Hamburg, Germany
   ___/   www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE+DINbSVDhKrJykfIRAgZ0AJ9mFJrYeUbeJyM6otFeodtgSzdsTQCeMBeH
pPjpLT4VVSKhW7aHjZAKQPA=
=x1T6
-END PGP SIGNATURE-


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Use a function?

2002-12-27 Thread Keith C. Ivey
On 27 Dec 2002, at 1:04, Peter D Bethke wrote:

 My table matchups has columns for team1_id, team2_id, team1_score and
 team2_score.
 
 I can write a simple calculation using the api I use (Lasso - similar in
 function to php) and display the results programmatically in the html
 output, not involving MySQL, but I wonder if I can use a function, or
 something similar to get a new column winner.

Something like this query maybe?

   SELECT team1_id, team2_id, team1_score, team2_score, CASE WHEN
  team1_score  team2_score THEN team1_id WHEN team1_score 
  team2_score THEN team2_id ELSE NULL END AS winner
   FROM matchups WHERE ...

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: birthday calculation problem

2002-12-27 Thread Gelu Gogancea
Hi,
I think you can try to use TO_DAYS() function;
eg:
select TO_DAYS('2002-12-28')-TO_DAYS(NOW());

Regards,

Gelu
_
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
  [EMAIL PROTECTED]
- Original Message -
From: Patrascu Eugeniu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 27, 2002 2:56 PM
Subject: birthday calculation problem


 Hi,

 I have a problem calculating birthdays in sql. Here goes my setup:

 I have a database that contains the bithdays of a number of people, and
 I want to know when there birthday is to congratulate them.
 The thing is that I want to now that a day before their birthday.
 Therefore I need a way to do that, and I do not know how to do it, so I
 am asking on this list, maybe there is someone that can tell me how.


 Regards,

 Patrascu Eugeniu










 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: birthday calculation problem

2002-12-27 Thread Paul DuBois
At 14:56 +0200 12/27/02, Patrascu Eugeniu wrote:

Hi,

I have a problem calculating birthdays in sql. Here goes my setup:

I have a database that contains the bithdays of a number of people, 
and I want to know when there birthday is to congratulate them.
The thing is that I want to now that a day before their birthday. 
Therefore I need a way to do that, and I do not know how to do it, 
so I am asking on this list, maybe there is someone that can tell me 
how.


Compare the MONTH() and DAYOFMONTH() values of your birthday column
to the MONTH() and DAYOFMONTH() values for tomorrow's date, which you
can calculate using CURDATE() and DATE_ADD().  Something like this:

SET @tomorrow = DATE_ADD(CURDATE(),INTERVAL 1 DAY);

SELECT * FROM tbl_name
WHERE MONTH(birth) = MONTH(@tomorrow)
AND DAYOFMONTH(birth) = DAYOFMONTH(@tomorrow);





Regards,

Patrascu Eugeniu



sql, query

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Trouble converting SQL from Access

2002-12-27 Thread Asendorf, John
OK, I've figured out how to fix the SQL (was searching for equations and
calculations when I should have been looking for math in the docs!)...
but now it takes EONS longer than the Jet calculations...

SELECT Dealers.*, SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
Distance
FROM Dealers 
INNER JOIN Zips ON Dealers.Zip = Zips.Zip
ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)

Any suggestions to speed this guy up?  There are 42,000 records in the Zips
table and 4,000 in the Dealers table.  The machine has a quad processor and
runs the same query (below) in a second or two via access/ASP.  With PHP/My
it is taking 99% of the processor and doesn't finish.

-
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


 -Original Message-
 From: Asendorf, John [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 27, 2002 10:03 AM
 To: [EMAIL PROTECTED]
 Subject: Trouble converting SQL from Access
 
 
 I'm attempting to convert an application from ASP/Access to 
 PHP/MySQL  My
 problem is in the SQL conversion.
 
 The SQL determines distance between two zip codes:
 
 This is the Access original:
 
 SELECT Dealers.*, ((2285-Zips.North)^2+(4760-Zips.West)^2)^.5 
 AS Distance
 FROM Dealers INNER JOIN Zips ON Dealers.Zip = Zips.Zip ORDER BY
 (2285-Zips.North)^2+(4760-Zips.West)^2
 
 The numbers in the calculations (such as the 2285 and 4760) 
 are brought in
 from the Zips table prior to this piece of SQL being sent.  
 I've tried a
 number of things (breaking it down into smaller chunks, changing ON to
 USING, etc.) but don't seem to be able to make the 
 calculation work in the
 SQL.
 
 Any help here?
 
 Thanks, John
 
 
 
 
 -
 John Asendorf - [EMAIL PROTECTED]
 Web Applications Developer
 http://www.lcounty.com - NEW FEATURES ADDED DAILY!
 Licking County, Ohio, USA
 740-349-3631
 Nullum magnum ingenium sine mixtura dementiae fuit
 
 -
 Please check 
http://www.mysql.com/Manual_chapter/manual_toc.html; before
posting. To request this thread, e-mail [EMAIL PROTECTED]

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail [EMAIL PROTECTED] instead.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




tailoring result display from multitable select

2002-12-27 Thread Andy Harrison
I'm trying to get results back from an sql query in the easiest way to 
handle in my script.

table 'categories' and table 'restcat' (restaurant categories).  

I'd like to construct a query where I can look up a specific restaurant 
id, yet somehow related it to the categories table so that instead of a 
regular select/where, I get back something like:


++--+--+
| restaurant | category | category |
++--+--+
| 136| Chinese  | NULL |
| 136| French   | NULL |
| 136| Italian  | Italian  |
| 136| Pizza| Pizza|
| 136| Seafood  | NULL |
++--+--+


Showing in this fashion that restaurant 136 is a member of the Italian 
and Pizza categories but not a member of the other categories.  

(and yes, my categories table actually uses category numbers)

Thanx for any help!

--
Andy




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



ÕæʵµÄÉç»áºÚ°µ... ...Ãñ²»ÁÄÉú!

2002-12-27 Thread Ãñ²»ÁÄÉú
ÄãÏàÐÅÂð£¿ÔÚÎÒÃÇÃÀºÃÉú»îµÄÉí±ß£¬Õý·¢Éú×ÅÁîÈË´¥Ä¿¾ªÐÄ£¬²Ò²»È̶õÄʼþ£¡
ÎÒÃÇ˵¿´µ½µÄÊÇ£º2700¶à¿ÚÀ§¿àµÄÅ©Ãñ£¬ÕýÔÚÉúËÀÏßÉϼèÄѵÄÕõÔú×Å£¡£¡

ÎÒ´ú±í2700¶à¿ÚÎÞ¹¼ÎÞÖúµÄËûÃÇ£º¿ÒÇóÉÆÁ¼µÄÄú£¬¿´ÍêÕâ·âÕæʵµÄÓʼþ£¡

µØµã£ººÓ±±Ê¡±£¶¨ÊÐÐÂÊÐÇø¸»²ýÏç´ó×£Ôó´å

ºÓ±±Ê¡±£¶¨Êи»²ýÏç  Ï絳ίÊé¼Ç--Àîºé¸Õ
  ´ó×£Ôó´å  ´åÖ§²¿Êé¼Ç--ÑîËùÓÐ

Àîºé¸ÕÔÚ´åÃñ¸ù±¾²»ÖªÇéµÄÇé¿öÏ£¬ÆÛÆ­´åÃñÒԵǼÇΪÃû£¬Ç¿ÐÐÊÕ»ØÍÁµØ£¬²¢Ë½×Ô½«´ó×£Ôó´å»ù±¾Å©Ìï685.74
ĶתÂô¸øºÓ±±Å©´ó£¬ÓÉÓÚËûÃDz»ºÏ·¨µÄÂòÂô¹Øϵ£¬ÖÂʹÎÒ´å1700¶àĶũÌï´óÃæ»ýÇ·ÊÕ£¬685.74ĶÍÁµØ»ù±¾¾øÊÕ
¡£ºÓ±±Å©´ó²¦¸¶ÁË£¤2000ÍòÔª°²Öò¹³¥·Ñºó£¬Õâ±Ê2000ÍòµÄ¿îÏî±»Àîºé¸Õ¡¢ÑîËùÓеÈÈË˽×ÔŲÓ㬲¢ÒÔ¡°´åÁ½
ί»áÈËÔ±µÄ¹¤×ʺ͸÷ÖÖÓ¦³ê·ÑÓá±ÎªÃû£¬²¢Ë½×Ô¿Û³ý£¤147ÍòÔª£¬2001Äê5ÔÂ28ÈÕ£¬ÑîÓÖ˽×Ôת×ßÁË£¤30ÍòÔª°²
ÖÃÍÁµØ²¹³¥·Ñ¡£2000ÍòµÄÔ­±¾ÊôÓÚ´åÃñµÄ²¹³¥¿î£¬¾ÍÕâÑù£¬±»ÕâЩ×ç³æ³Ôµô£¬´åÃñÓÉÓÚ×Ô¼ºµÄÍÁµØ±»ÂӶᣬû
ÓÐÁ˸ûÖÖÍÁµØ£¬Ã»ÓÐÁ˾­¼ÃÀ´Ô´£¬²¹³¥¿îҲûÓУ¬2700¶à¿ÚÈËΪһ¶Ù·¹ÕõÔúÉú»î×Å£¬¿´×ÅËûÃǿݻƵÄÃæÈÝ£¬·ß
Å­µÄÑÛÉñ¡£¡£¡£¡£¡£
´åÃñÃÇ×Ô·¢µ½´ó¶Ó´åί»áÒªÇó¿´ÂôµØºÏͬÊ飬Ôâµ½¾Ü¾ø£¬´åÃñÃǶԴËÌá³öÒÉÎÊ£¬´åµ³Ö§Êé¶Ô´ËÖÃÖ®²»Àí¡£ËûÃÇ
ÏùÕÅ°ÏìèµÄ˵£º¡°Å©´óÕ÷Óôó×£Ôó´åÍÁµØÊÇÊÐί¾ö¶¨µÄ£¬ÕâµØÂôÒ²µÃÂô£¬²»ÂôÒ²µÃÂô£¡Òª¿´µØ¼ÛԭʼÎļþºÍ¹ú
ÍÁ×ÊÔ´²¿µÄÅúʾ£¬±ÈµÇÌì²»»¹ÄÑ£¡³ý·ÇÕªÏÂÌìÉϵÄÐÇÐÇ£¡¡±
ΪÁËÈÃƶ¿àµÄ´åÃñ¶Ô×Ô¼ºµÄ800ĶÖÖµØËÀÐÄ£¬Àîºé¸ÕµÈÈËÔÚ2001Äê5Ô¿ªÊ¼ÆÆ»µ£¬ÍÁµØ¹à¸ÈʹÓõÄË®µçÉèÊ©£¬ÈË
Ϊ½«ÍÁµØÖÆÔì³ÉÈý¼¶»Ä·ÏµØ£¬µ¼ÖÂÍÁµØÈ«²¿»ÄÎߣ¬³¤Âú°ëÈ˸ßÔӲݡ£¡£¡£¡£
ÓÉÓÚ·ßÅ­´åÃñµÄ×èµ²£¬ºÓ±±Å©´ó¶à´Î¶Ô800ĶÍÁµØÊ©¹¤Î´¹ûµÄÇé¿öÏ£¬2001Äê10ÔÂ26ÈÕÉÏÎç9£º30£¬Àîºé¸Õ¡¢Ñî
ËùÓУ¬¿ª×ž¯³µ£¬´ø×Å·À±©¾¯²ì£¨100¶àÃû£©¼°ÏçÁª·À¶ÓÔ±¹²200¶àÈË£¬´ø×ÅÊÖîí¡¢Í·´÷¸Ö¿ø£¬ÊÖÎÕ¾¯¹÷£¬Í£ÔÚ
´ó×£Ôó´å800ĶÍÁµØÊ©¹¤´¦£¬×¼±¸Ç¿ÐÐÊ©¹¤£»È«´å´åÃñÎÅÖªºó£¬È«²¿×ÔÔ¸¾Û¼¯ÔÚÊ©¹¤´¦£¬¿¹ÒéËûÃÇ·Ç·¨Õ¼ÓÃÍÁµØ
£¡Õâʱ£¬·À±©¾¯²ì¼°ÏçÁª·À¶ÓÔ±¹²200¶àÈËÊÖÎÕ¾¯¹÷³å½øÈËȺ£¬¶ÔÊÖÎÞ´çÌúµÄƶ¿à´åÃñ´ó´ò³öÊÖ£¬ÔÚ´åÃñµÄһƬ
¿ÞÉùÖУ¬ÑÏÖØ´òÉËÈýÈË£¬Ë¤ÉË70¶àËêÀÏÈ˳´óÓ꣬ÉõÖÁÁ¬²Ð¼²È˳¯Ó­´º¶¼²»·Å¹ý¡£×îºó£¬ÎªÇý¸Ï¿ÉÁ¯µÄ´åÃñ£¬
³ö¶¯ÍÏÀ­»úÏò´åÃñײȥ£¬ÖÂʹ1ÈËÖ²У¨ºó²»Ö¶øËÀ£©£»8ÈËÖØÉË£»40ÓàÈËÇáÉËסԺÖÎÁÆ£¬²¢×¥×ß´åÃñ´ú±íÁõϲ
°®ºÍÅ£Ã÷»ª¶þÈË¡£µ±Ê±±¯²ÒµÄ´åÃñ¿ÞÉùһƬ£¬·ßÅ­µØ¿ÞËßÕþ¸®Ö÷Òª¸ºÔðÈËÕòѹȺÖڵIJб©£¡£¡


±©´ò¼ÇÕߣ¬×èֹýÌ屨µÀ
2002Äê3ÔÂ17ÈÕ12µã£¬Óɱ£¶¨ÊеçÊǪ́¼°ÆäÏà¹ØýÌ岿ÃÅÒ»ÐÐ6ÈË£¬µ½±»µ¹ÂôµÄÅ©Ìï´¦½øÐвɷù¤×÷¡£Õýµ±´åÃñ¿ÞËßÔ©Çü֮ʱ£¬ÑîËùÓм°ÆäÖ¶×ÓÑî´º·æ´øÁìÁª·ÀÈËÔ±20¶àÈË£¬ÊÖ³Öľ¹÷£¬³åÏò¼ÇÕߣ»²¢µ±³¡»Ù»µÂ¼ÒôÉ豸¡¢ÉãÓ°É豸£¬±©¹â¼ÇÕßËùÅĵĽºÆ¬£¡ÑîËùÓе±Ê±ÏùÕŵĺ°µÀ£º¡°¼´Ê¹ÖÐÑë¼ÇÕßÀ´£¬Ò²²»ÐíÅÄ£¡ÕâÊǼÒÊ£¬ÄãÃÇûÓÐȨÀû¹Ü£¡ÖªÈ¤µÄÂíÉÏ×ߣ¡·ñÔò´òµ½ÄãÃÇ×ßΪֹ£¡¡±¡£µ±Ê±´åÃñ·ßÅ­µÄ³åÉÏÀ´±£»¤×żÇÕߣ¬20¶àÁª·ÀÈËÔ±¾Ù×Åľ¹÷ºÝºÝµØÔÒÔÚΧÔÚ¼ÇÕßÇ°ÃæµÄ´åÃñÉíÉÏ£¡¼ÇÕßÃDZ»µ±Ç°µÄ³¡ÃæÏÅסÁË£¬¸ÏæÌÓÏòÀ´ÊǵÄÃæ°ü³µÉÏ¡£ÑîËùÓÐָ׿ÇÕߺ°¡°°ÑËûÃÇÏà»ú¶¼¸øÎÒ½ØÏÂÀ´£¡¸æËßËûÃÇ¡®Ë­Ò²²»Òª¶à×죡·ñÔòÈÃÄãÃÇÓÐÀ´Î޻أ¡¡¯¡±Áª·ÀÈËÔ±ÌýÎźó£¬×·´ò¼ÇÕß²»Ö¹£¬²¢ÔÒÀÃÃæ°ü³µ¶à´¦...
 ... 
¼ÇÕßÃÇØ÷»Ì¶øÈ¥¡£µ±Íí£¬ÔÚ±£¶¨ÐÂÎżòѶÖУ¬±¨µÀ´ËÊ¡£µÚ¶þÌ죬ÑîËùÓÐÈôÎÞÆäʵظæ½ë´åÃñÃÇ¡°ÄãÃÇÒÔΪһ¸ö±£¶¨ÊеçÊǪ́£¬¾Í¿ÉÒÔ°ÑÎÒÃÇ°âµ¹Âð£¿ÄãÃDZð¸ßÐËÌ«ÔçÁË£¡²»¹ÜË­£¬µ±Ê±ÄÜ°ïÖúÄãÃÇ£¬¹ýºóÎÒ¾ÍÄÜÊÕÊ°ÄãÃÇ£¡¡±¹û²»ÆäÈ»£¬Ò»¸öÔ£¬¶þ¸öÔ£¬¼¸¸öÔ¹ýÈ¥ÁË£¬Ã»ÓÐÈκÎÏûÏ¢.
 .



ÎÞ¹¼´åÃñÁõ¹óϲ£¬ÎºÍ¬°²²»Ã÷²»°×²ÒËÀ¡£ÖÁ½ñ£¬²»ÄÜ»¹ÒÔ¹«µÀ£¡
2001Äê12ÔÂ21ºÅÇ峿£¬´åÃñÔÚ¾©¹ãÌú·±±²à·Àºé¹µÖз¢ÏÖ´åÃñÁõ¹óϲ£¬ÎºÍ¬°²Á½ÈËʬÌ壡´Ë¶þÈËÒ»Ö±ÊÇ´åÃñÖеĴú±í¡£´åÖ÷ÈÎÑî´º·æµ½´ïÏÖ³¡ºó£¬ÔÚûÓÐÁ˽âÈκÎÇé¿öµÄÇ°ÌáÏ£¬ÅÐÂÛ¶þÈËΪ×í¾ÆÄçËÀ£¬²¢ÂíÉϽ«¶þÈËʬÌåËÍ´ï»ðÔ᳡»ð»¯...
 ...


1996Ä꣬ÑîËùÓÐÒÀÕÌְȨδͨ¹ýÖ§²¿ÌÖÂۺʹåÃñµÄÉÌÁ¿£¬Ò²Î´Í¨¹ýÆÀ¹ÀºÍÕб꣬½«´ó×£Ôó´åÔìÖ½³§Âô¸øËûÖ¶×ÓÑî´ºÔª£¬ËùÂô¿îÏî²»Òí·É£¡ÔìÖ½³§ÍÏÇ·ÒøÐдû¿î£¤180¶àÍòÔª£¬¾¹È»Òª±¾´å´åÃñ¸ºµ£¡£

ÖÐÐËÆû³µ³§Âò±¾´åÍÁµØ¿î£¤280ÍòÔª£¬Ã»Óзָø´åÃñÒ»·ÖÇ®£¬ÑîËùÓн«Õâ±Ê¿îÏî˽×ÔÍ̲¢£¡

Ô­±£¶¨ÊеڶþÖÐѧ£¬Õ¼Óôó×£Ôó´åÍÁµØ17.67Ķ£¬µØÉϽ¨ÖþÎïÉÏ°Ù¼äƽ·¿ºÍһ̨±äѹÆ÷£¬×ܼÛÖµ´ï£¤250ÍòÔªÖ®¶à£¬µ«Ê®¶þÖÐѧ°áǨºó£¬ÔÚ´åÃñʲôҲ²»ÖªµÀµÄÇé¿öÏ£¬Ö»ÂôÁË£¤95ÍòÔª£¬ËùÂô¿îÏîҲȥÏò²»Ã÷¡£

ÑîËùÓзǷ¨ÂòÂôÕ¬»ùµØ40¶à´¦£¬¶àµÄһĶ¶à£¬ÉÙµÄÒ²ÓÐËÄÎå·Ö£¬²»µ«ÑÏÖØÎ¥·´Á˹ú¼ÒÍÁµØ·¨£¬ËùµÃ¿îÈ«²¿Ë½×ÔÍ̲¢¡£

±£¶¨ÊÐÌïÒ°Æû³µÖÆÔ쳧ռÓñ¾´åÍÁµØËùÂô¿îÏÂÂä²»Ã÷£¬Ôø²¹³¥¸ø±¾´åÈýÁ¾ÌïÒ°ÅÆгµºÍ±¾´åËùÂò212¼ªÆÕ³µÒ»Á¾£¬Á½Î¯»áʹÓÃÒ»Äêºó£¬ÕâЩ³µÈ¥Ïò²»Ã÷¡£

±¾´å½ü400¶àĶ¸ûµØΪÆóÒµËùÕ¼¡££¨ÆäÖÐ200¶àĶûÓÐÉóÅúÊÖÐø¡££©
±¾´åÈËÔ±Õ¼µØÿÄêÿĶÊÕ·Ñ£¤2000Ôª£¬·Ç±¾´åÈËÔ±Õ¼µØÿÄêÿĶÊÕ·Ñ£¤3000Ôª£¬×ÔÑîËùÓÐÈδåÖ§²¿Êé¼ÇÒÔÀ´ÖÁ2001Äê¹²ÊÕÈëÕ¼µØ·Ñ£¤2200ÍòÔª×óÓÒ£¡

¾©¹ãÌú·ÌáËÙ£¬ÔÚ±¾´åÉèÖõصÀÇÅ£¬´åί»áÄõ½Ç®ºó£¬´åÃñ·´Ó³ÓнØÁôÐÐΪ£¬¸üΪÑÏÖصÄÊÇ£¬´åί»áÉÃ×ԸıäͼֽҪÇóÎ¥¹æÊ©¹¤£¬ÖÂʹÇÅÏ»ýË®£¬ÑÍËÀ±¾´åÁ½Ãû¶ùͯ¡£

ÑîËùÓÐÒÀÕÌ°Ý°ÑÐÖµÜÀîºé¸ÕµÄȨÊÆ£¬³¤ÆÚÂÊÁ½Î¯»á³ÉÔ±¾Þ¶Ä£¬Ôø±»±£¶¨ÊÐÄÏÊÐÇø¡¢±±ÊÐÇø¡¢ÐÂÊÐÇø¹«°²¾Öץס¹ýÈý´Î¡£µÚÈý´Î±»×¥Ê±£¬ÊÇÔÚСףÔó´åÈýÅã¹ÝץסµÄ£¬ÆäÖÐÓÐÊé¼ÇÑîËùÓС¢µ³Ô±ÎºÏ²Îä¡¢ÔÚÌÓ·¸Öα£ÔªÔ±¡¢ÑîËùÓеÄÖ¶×ÓÑîÈýµÈ¡£ÆäÉú»îÃÓÀ㬳¤ÆÚ°üÑø°²»ÕС½ãÌïΰ£¨Ô­ÔÚõ¹åÔ°¸èÎèÌü£¬ÏÖÔÚÀÖ´ï¾Æµê£©£¬¾ÍÕâÑùÒ»¸ö´åÖ§²¿Êé¼Ç£¬Ëù´øÁìµÄµ³Ö§²¿È´±»Ï絳ίÊÚÓèÏȽøµ³Ö§²¿ºÍÄ£·¶µ³Ö§²¿µÈ¹âÈٳƺš£¿É¼ûÑîËùÓкÍÀîºé¸ÕÖ®¼äµÄ¹ØϵÒѵ½Á˺ÎÖ̶ֳȣ¡

×Ôʼþ·¢Éúºó£¬ÔâÊܲ»¹«µÄ´åÃñÃÇΪÁËÉú´æ£¬ÎªÁ˹«Õý£¬
´åÁ½Î¯»á¸É²¿Ê¹ÓÃÉϵÄȹ´ø¹Øϵ£º£¨Ï絳ίÊé¼ÇÀîºé¸ÕÓëÑîËùÓÐÊÇ°Ý°ÑÐֵܣ©
´åÁ½Î¯»áÁìµ¼¸É²¿¼°³ÉÔ±ÈçÏ£º
ÏÖÈδ嵳֧²¿Êé¼Ç£ºÑîËùÓÐ   ¸±Êé¼Ç£ºãÆÕñÏé
ίԱ£º¹ùÇÉÁᡢκÎÄÖÒ
ÏÖÈδåί»áÖ÷ÈΣºÑî´ºo ¸±Ö÷ÈΣº³Â¶«Éý
ίԱ£ºÈ¨½¨¹ú¡¢ÎºÎÄÖÒ¡¢¹ùÇÉÁá
ÏÖÈμƻ®ÉúÓýίԱ»áÖ÷ÈΣººúÀ¼ÔÆ¡¢¹ùÇÉÁá


Fwd: Re: RE: Trouble converting SQL from Access

2002-12-27 Thread Steve Yates
On Fri, 27 Dec 2002 13:11:42 -0500, Asendorf, John wrote:
SELECT Dealers.*, SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
Distance
FROM Dealers 
INNER JOIN Zips ON Dealers.Zip = Zips.Zip
ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)

Off the top of my head have you tried not calculating the order
by field again?  Something like:

SELECT Dealers.*, POW((2285-Zips.North),2)+POW((4760-Zips.West),2) as
L, SQRT(L) AS Distance
FROM Dealers 
INNER JOIN Zips ON Dealers.Zip = Zips.Zip
ORDER BY L

(or should it be order by Distance?)

 - Steve Yates
 - 62% of those polled felt polls asked trivial questions.

~ Taglines by Taglinator - www.srtware.com ~

sql


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Trouble converting SQL from Access

2002-12-27 Thread Asendorf, John
Well, I decided to stop being a moron and think inside the box and figured
out that it was the total and utter lack of keys and indexes on the newly
created MySQL tables which caused the execution time problem.  So, the
problem turned out to be, I'm a moron.

Thanks everyone who replied!

Here's the final query.  It runs in about .3 second:

SELECT Dealers.*, 
ROUND(SQRT(POW(2285-Zips.North,2)+POW(4760-Zips.West,2)),1) AS Distance
FROM Dealers 
INNER JOIN Zips ON Dealers.Zip = Zips.Zip
ORDER BY Distance

 -Original Message-
 From: Asendorf, John [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 27, 2002 1:12 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: Trouble converting SQL from Access
 
 
 OK, I've figured out how to fix the SQL (was searching for 
 equations and
 calculations when I should have been looking for math in 
 the docs!)...
 but now it takes EONS longer than the Jet calculations...
 
 SELECT Dealers.*, 
 SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
 Distance
 FROM Dealers 
 INNER JOIN Zips ON Dealers.Zip = Zips.Zip
 ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)
 
 Any suggestions to speed this guy up?  There are 42,000 
 records in the Zips
 table and 4,000 in the Dealers table.  The machine has a quad 
 processor and
 runs the same query (below) in a second or two via 
 access/ASP.  With PHP/My
 it is taking 99% of the processor and doesn't finish.
 
 -
 John Asendorf - [EMAIL PROTECTED]
 Web Applications Developer
 http://www.lcounty.com - NEW FEATURES ADDED DAILY!
 Licking County, Ohio, USA
 740-349-3631
 Nullum magnum ingenium sine mixtura dementiae fuit
 
 
  -Original Message-
  From: Asendorf, John [mailto:[EMAIL PROTECTED]]
  Sent: Friday, December 27, 2002 10:03 AM
  To: [EMAIL PROTECTED]
  Subject: Trouble converting SQL from Access
  
  
  I'm attempting to convert an application from ASP/Access to 
  PHP/MySQL  My
  problem is in the SQL conversion.
  
  The SQL determines distance between two zip codes:
  
  This is the Access original:
  
  SELECT Dealers.*, ((2285-Zips.North)^2+(4760-Zips.West)^2)^.5 
  AS Distance
  FROM Dealers INNER JOIN Zips ON Dealers.Zip = Zips.Zip ORDER BY
  (2285-Zips.North)^2+(4760-Zips.West)^2
  
  The numbers in the calculations (such as the 2285 and 4760) 
  are brought in
  from the Zips table prior to this piece of SQL being sent.  
  I've tried a
  number of things (breaking it down into smaller chunks, 
 changing ON to
  USING, etc.) but don't seem to be able to make the 
  calculation work in the
  SQL.
  
  Any help here?
  
  Thanks, John
  
  
  
  
  -
  John Asendorf - [EMAIL PROTECTED]
  Web Applications Developer
  http://www.lcounty.com - NEW FEATURES ADDED DAILY!
  Licking County, Ohio, USA
  740-349-3631
  Nullum magnum ingenium sine mixtura dementiae fuit
  
  
 -
  Please check 
 http://www.mysql.com/Manual_chapter/manual_toc.html; before
 posting. To request this thread, e-mail 
 [EMAIL PROTECTED]
 
 To unsubscribe, send a message to the address shown in the
 List-Unsubscribe header of this message. If you cannot see it,
 e-mail [EMAIL PROTECTED] instead.
 
 -
 Please check 
http://www.mysql.com/Manual_chapter/manual_toc.html; before
posting. To request this thread, e-mail [EMAIL PROTECTED]

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail [EMAIL PROTECTED] instead.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL 4.0.7 is released

2002-12-27 Thread Lenz Grimmer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

MySQL 4.0.7, a new version of the popular Open Source Database, has been
released. It is now available in source and binary form for a number of
platforms from our download pages at http://www.mysql.com/downloads/ and
mirror sites.

Around the time MySQL 4.0.6 was ready to be released to fix the security
vulnerabilities that have been reported to us by eMatters GmbH, we were
informed about another potential security vulnerability. Because the 4.0.6
builds were almost completed at this point, and we wanted to get these out
to fix the already widely known security issues, we decided to resolve
this vulnerability for MySQL 4.0.7 instead and release it immediately
after MySQL 4.0.6.

Users that use previous versions of MySQL 4.0 in an untrusted multi-user
environment (e.g. ISPs providing database hosting) are encouraged to
update to MySQL 4.0.7 as soon as possible.

Please note, that this new vulnerability does only affect MySQL 4.0 -
MySQL 3.23 is not affected by this bug.

A short description of the vulnerability:

 o MySQL 4.0 did not properly check the user's privileges when receiving
   the (deprecated) client function call mysql_drop_db() to drop the
   specified database.
 o This allowed any user to arbitrary drop any database, if he was able
   to log in as a valid user and his MySQL client application used the
   obsolete mysql_drop_db() function call instead of the DROP DATABASE
   SQL statement.
 o When using DROP DATABASE, the user's privileges were always verified
   correctly before dropping the database.
 o This bug can not be exploited without a valid MySQL user account -
   it is not possible for an anonymous remote attacker to perform this
   operation.
 o So far, we are only aware of one client application that still uses
   this function call.
 o The mysql client application provided with the MySQL distribution
   as well as the MySQL Control Center cannot be used to exploit this
   vulnerability.
 o No data was compromised from other users' databases - this bug did not
   affect the privileges required to actually read data from other
   databases or tables.
 o If logging was enabled (e.g. by using the --log or --log-bin
   command line switches), the operation was also logged by the MySQL
   server, including the user and host name (if --log was used).

We would like to thank Gary Huntress for making us aware of this problem.


News from the MySQL 4.0.7 ChangeLog:

Functionality added or changed:

 * `mysqlbug' now also reports the compiler version used for building
   the binaries (if the compiler supports the option `--version').

Bugs fixed:

 * Fixed compilation problems on OpenUnix and HPUX 10.20.

 * Fixed some optimisation problems when compiling MySQL with
   `-DBIG_TABLES' on a 32 bit system.

 * `mysql_drop_db()' didn't check permissions properly so anyone could
   drop another users database.  `DROP DATABASE' is checked properly.


Additional notes:

 * It is quite possible that not all mirror sites have picked up
   the Linux RPM packages yet, because the were added some time after
   the other binary packages.

 * Due to a hardware failure, we are currently unable to provide
   Solaris 2.7 binaries - we apologize for any inconveniences that
   may cause you. Some users reported, that the Solaris 2.8 package
   worked for them on Solaris 2.7, too - so you might want to give
   that a try. We are working on setting up a new Solaris 2.7 build
   system and hope to have it available for future releases again.

Happy New Year!

Bye,
LenZ
- -- 
For technical support contracts, visit https://order.mysql.com/?ref=mlgr
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /  Mr. Lenz Grimmer [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Production Engineer
/_/  /_/\_, /___/\___\_\___/ Hamburg, Germany
   ___/   www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE+DLPGSVDhKrJykfIRAs4IAJwMA0K2zWYylGGUTi6utqt3PTrNRgCbBvHX
UUL38wzEmLUc1MQIygKI094=
=nxCr
-END PGP SIGNATURE-


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: MySQL 4.0.7 is released

2002-12-27 Thread Hsiao Ketung Contr 61 CS/SCBN

Hello,

I'm a new user to MySql and I've just starting to download and install
MySql.

I've a question:
Does each version of MySql has binary AND src version for installation ?
I've been to  http://www.mysql.com/downloads/ for MySQL 4.0.7 and I found
binary version only.

Does the majority of MySql user us the binary version ?
Who would have the need to use src version of installation.
I imagine that src version give user more options for customizing MySql.

I'm installing MySql for use with vbulletin software from www.bulletin.com
and 
I'm concerned whether I should install binary or src version of MySql.




-Original Message-
From: Lenz Grimmer [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 27, 2002 12:11 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: MySQL 4.0.7 is released


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

MySQL 4.0.7, a new version of the popular Open Source Database, has been
released. It is now available in source and binary form for a number of
platforms from our download pages at http://www.mysql.com/downloads/ and
mirror sites.

Around the time MySQL 4.0.6 was ready to be released to fix the security
vulnerabilities that have been reported to us by eMatters GmbH, we were
informed about another potential security vulnerability. Because the 4.0.6
builds were almost completed at this point, and we wanted to get these out
to fix the already widely known security issues, we decided to resolve
this vulnerability for MySQL 4.0.7 instead and release it immediately
after MySQL 4.0.6.

Users that use previous versions of MySQL 4.0 in an untrusted multi-user
environment (e.g. ISPs providing database hosting) are encouraged to
update to MySQL 4.0.7 as soon as possible.

Please note, that this new vulnerability does only affect MySQL 4.0 -
MySQL 3.23 is not affected by this bug.

A short description of the vulnerability:

 o MySQL 4.0 did not properly check the user's privileges when receiving
   the (deprecated) client function call mysql_drop_db() to drop the
   specified database.
 o This allowed any user to arbitrary drop any database, if he was able
   to log in as a valid user and his MySQL client application used the
   obsolete mysql_drop_db() function call instead of the DROP DATABASE
   SQL statement.
 o When using DROP DATABASE, the user's privileges were always verified
   correctly before dropping the database.
 o This bug can not be exploited without a valid MySQL user account -
   it is not possible for an anonymous remote attacker to perform this
   operation.
 o So far, we are only aware of one client application that still uses
   this function call.
 o The mysql client application provided with the MySQL distribution
   as well as the MySQL Control Center cannot be used to exploit this
   vulnerability.
 o No data was compromised from other users' databases - this bug did not
   affect the privileges required to actually read data from other
   databases or tables.
 o If logging was enabled (e.g. by using the --log or --log-bin
   command line switches), the operation was also logged by the MySQL
   server, including the user and host name (if --log was used).

We would like to thank Gary Huntress for making us aware of this problem.


News from the MySQL 4.0.7 ChangeLog:

Functionality added or changed:

 * `mysqlbug' now also reports the compiler version used for building
   the binaries (if the compiler supports the option `--version').

Bugs fixed:

 * Fixed compilation problems on OpenUnix and HPUX 10.20.

 * Fixed some optimisation problems when compiling MySQL with
   `-DBIG_TABLES' on a 32 bit system.

 * `mysql_drop_db()' didn't check permissions properly so anyone could
   drop another users database.  `DROP DATABASE' is checked properly.


Additional notes:

 * It is quite possible that not all mirror sites have picked up
   the Linux RPM packages yet, because the were added some time after
   the other binary packages.

 * Due to a hardware failure, we are currently unable to provide
   Solaris 2.7 binaries - we apologize for any inconveniences that
   may cause you. Some users reported, that the Solaris 2.8 package
   worked for them on Solaris 2.7, too - so you might want to give
   that a try. We are working on setting up a new Solaris 2.7 build
   system and hope to have it available for future releases again.

Happy New Year!

Bye,
LenZ
- -- 
For technical support contracts, visit https://order.mysql.com/?ref=mlgr
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /  Mr. Lenz Grimmer [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Production Engineer
/_/  /_/\_, /___/\___\_\___/ Hamburg, Germany
   ___/   www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE+DLPGSVDhKrJykfIRAs4IAJwMA0K2zWYylGGUTi6utqt3PTrNRgCbBvHX
UUL38wzEmLUc1MQIygKI094=
=nxCr
-END PGP SIGNATURE-



Quick from Commandline; very slow from Perl

2002-12-27 Thread Nicholas Elliott
Hey there,

Does anyone know why a query would take a very long time (15 minutes) from
my CGI script, yet takes less than a second if I cut-and-paste into my
console?

The query itself amounts to this:
SELECT ((a.PRECIP(0.00*AVG(b.PRECIP/100, a.DATE
FROM clim_data AS a
LEFT JOIN clim_data as b ON a.station=b.station and b.DATE=a.DATE - INTERVAL
30 DAY
WHERE a.station IN ('426409',
... long list of ID codes, about 500 of them ...
'WYTOR') AND a.DATE=20010101 AND a.DATE=20010102
GROUP BY DAYOFYEAR(a.DATE), a.station
...
1174 rows in set (0.53 sec)

My code is pretty simple:
-
$Result = RunQuery($q1$q2$q3);
   my %attribs;
   while(($value, $date)=$Result-fetchrow_array)
   {
$attribs{$date} += $value;
   }
   $Result-finish;

--

sub RunQuery {
 my ($query) = @_;
 my $query_submittion = $database-prepare($query);
 Debug(5, $query);
 $query_submittion-execute() or Debug(1, $database-errstr, Query Error on
\$query\);
 return $query_submittion;
}

--

But the server eventually will time-out.  A query involving only one date
requires next to no time if I type it in manually, but 10 minutes from my
webpage.

Are there any variables I might have set wrong that would cause this to
happen?  The MySQL server is on the same machine as the Apache one, and
there are a large number of rows being returned from this query.  My first
thought is that the number of station ids being sent is what is taking so
long.

Any help is appreciated!

Thanks,
Nick Elliott


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




start value in table

2002-12-27 Thread Martin Skjöldebrand
Sorry for this newbie question (my MySQL-book is at work).
I want my ID field to start with value 1000 and (preferably)
auto-increment to 2000 is this possible to specify in my table somehow?
(I know auto-increment, just how do I set the starting value).
What would the appropriate SQL-sentence to update the table be?

Cheers,

Martin S.
-- 
Martin Skjoldebrand
http://www.skjoldebrand.org


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Desperate - failed: Lost connection to MySQL server during query

2002-12-27 Thread Chris Faust
Hello All,

This mail list is about my last hope as I tried everything I could possibly
find online related to this problem and I've had no luck (it doesn't appear
to be the GLib problem that everyone keeps talking about).

Machine Specifics:

Web Server (dedicated):
P4 2gHz with 2gig memory
RedHat 8.0
Apache 2.0
Perl 5.8 and latest DBI
glibc-2.2.93-5

DB Server (dedicated):
P4 2gHz with 2gig memory
mySql 3.23.54

The problem is this, everytime the web server starts to work a little (load
via a uptime showing about 6), 1 out of 5 scripts bomb out with the message
of:

failed: Lost connection to MySQL server during query

As load gets higher then the rate of failure gets higher.

There is NOTHING being reported by mysql on the DB server, even with
warnings turned on - no DB restarts or nothing like that and at no time is
load of any concern on the DB server nor do we have any problems with
max_connections or anything of that nature.

I have 3 other mysql boxes up and running (that work fine) and I went
through all the default values given via the mysqladmin variables and
everything is the same across multiple machines.

I've found a ton of messages that show this same problem and they all relate
to the RedHat version of Glib which is prior to mine.
Also the reports I've seen all say this happens 100% of the time and in my
case it only happens when load is high.
Finally the reports say it causes mysqld to crash and restart which isn't
happening (mysql isn't complaining about a thing).

Does anyone out there have any idea? I'm at a total loss, everything is fine
until load gets up there a little (and what little there is isn't
overloading anything).

Thanks In Advance!
-Chris



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




scanning for auto increment columns

2002-12-27 Thread Greg Matthews
All,

I'd like to be able to query MySql using the JDBC driver to determine which
tables have auto incremented columns.

In MSSQL I can retrieve data from the syscolumns and sysobjects tables to
find out which columns are IDENTITY columns, but have had no luck trying to
do something similar in MySql (4.05).

e.g.

select so.name, sc.name from syscolumns sc, sysobjects so where sc.autoval
is not null and so.xtype = 'U' and so.id = sc.id order by 1,2


I'm extending some J2EE app generator functionality, and so would like to be
able to scan a database without knowing beforehand (based on business
knowledge) which tables have auto incremented columns.

I've tried:

1. Going over the java.sql metadata functionality to see if I can query this
through the standard java.sql functions.

2. Searching the MySql manual

Any help much appreciated.

Greg.


sql, query


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: start value in table

2002-12-27 Thread Fernando Grijalba
I believe it is

CREATE TABLE{
  id AUTOINCREMENT=1000,
  fld TYPE
}

HTH

JFernando
** sql **

-Original Message-
From: Martin Skjöldebrand [mailto:[EMAIL PROTECTED]]
Sent: December 27, 2002 16:34
To: MySQL epostlista
Subject: start value in table


Sorry for this newbie question (my MySQL-book is at work).
I want my ID field to start with value 1000 and (preferably)
auto-increment to 2000 is this possible to specify in my table somehow?
(I know auto-increment, just how do I set the starting value).
What would the appropriate SQL-sentence to update the table be?

Cheers,

Martin S.
--
Martin Skjoldebrand
http://www.skjoldebrand.org


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: start value in table

2002-12-27 Thread Martin Skjöldebrand
fre 2002-12-27 klockan 22.34 skrev Martin Skjöldebrand:
 Sorry for this newbie question (my MySQL-book is at work).
 I want my ID field to start with value 1000 and (preferably)
 auto-increment to 2000 is this possible to specify in my table somehow?
 (I know auto-increment, just how do I set the starting value).
 What would the appropriate SQL-sentence to update the table be?
 
ALTER TABLE `printers` CHANGE `ID` `ID` INT( 11 ) DEFAULT '1000' NOT
NULL AUTO_INCREMENT

apparently wont do as I can't have a primary key incremented from a
default value of 1000. I am going about this the wrong way, am I not.

/Martin S.
-- 
Martin Skjoldebrand
http://www.skjoldebrand.org


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: scanning for auto increment columns

2002-12-27 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Greg Matthews wrote:

All,

I'd like to be able to query MySql using the JDBC driver to determine which
tables have auto incremented columns.

In MSSQL I can retrieve data from the syscolumns and sysobjects tables to
find out which columns are IDENTITY columns, but have had no luck trying to
do something similar in MySql (4.05).

e.g.

select so.name, sc.name from syscolumns sc, sysobjects so where sc.autoval
is not null and so.xtype = 'U' and so.id = sc.id order by 1,2


I'm extending some J2EE app generator functionality, and so would like to be
able to scan a database without knowing beforehand (based on business
knowledge) which tables have auto incremented columns.

I've tried:

1. Going over the java.sql metadata functionality to see if I can query this
through the standard java.sql functions.

2. Searching the MySql manual

Any help much appreciated.

Greg.


sql, query


You can look for 'auto_increment' in the 'REMARKS' column that is in the 
ResultSet created by DatabaseMetaData.getColumns().

You could also just do a 'show columns from tablename' and look for 
'auto_increment' in the 'Extra' field.

JDBC itself does not provide a way from DatabaseMetaData to determine 
auto-increment or identity columns directly, only from ResultSetMetaData :(

	-Mark

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+DNZhtvXNTca6JD8RAsfxAKCKSFMa6oH+e3Z0DfkbEsd0dWixSgCgpwyt
ublIE8OpfEonCjayj1LMIsg=
=BZew
-END PGP SIGNATURE-


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: start value in table

2002-12-27 Thread Keith C. Ivey
On 27 Dec 2002, at 16:54, Fernando Grijalba wrote:

 I believe it is
 
 CREATE TABLE{
   id AUTOINCREMENT=1000,
   fld TYPE
 }

Where did you see anything like that in the documentation?

I believe what Martin wants is something like 

   ALTER TABLE table_name AUTO_INCREMENT = 1000;

[Filter fodder: SQL]

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: start value in table

2002-12-27 Thread Paul DuBois
At 22:34 +0100 12/27/02, Martin Skjöldebrand wrote:

Sorry for this newbie question (my MySQL-book is at work).
I want my ID field to start with value 1000 and (preferably)
auto-increment to 2000 is this possible to specify in my table somehow?


This question is ambiguous.  Do you mean that you want a starting value
of 1000, and for subsequent records to auto_increment by 1000 each time?
If so, you cannot ask MySQL to do that automatically.

Or do you mean that you want the normal increment-by-one behavior, but
you just want the first value to be 1000?  If so, use a MyISAM table,
and declare it as follows:

CREATE TABLE tbl_name (column definitions here)
TYPE = MyISAM AUTO_INCREMENT = 1000;

The final AUTO_INCREMENT = n clause causes the first record to be assigned
that value in the AUTO_INCREMENT column.


(I know auto-increment, just how do I set the starting value).
What would the appropriate SQL-sentence to update the table be?

Cheers,

Martin S.
--
Martin Skjoldebrand
http://www.skjoldebrand.org




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: View image from browser

2002-12-27 Thread Michael She
What language are you using to pull the data?  ASP?  PHP?  VB?


At 11:23 PM 12/26/2002 -0800, tan tan wrote:

Hi,

Is anyone know how to view image that is stored in
mysql as binary format to
a browser ?

Thank you.


--
Michael She  : [EMAIL PROTECTED]
Mobile   : (519) 589-7309
WWW Homepage : http://www.binaryio.com/



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




certification exam

2002-12-27 Thread John Coder
sql, query, mysql,I'm a lumberjack and I'm ok for he spam police.

 

Has anyone been successful in signing up for the certification exam?
I've entered dates going up to Jume 30,2003 to schedule an exam and all
I get back is exam not available.

John



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Bug report: UNIQUE KEY and DESCRIBE TABLE

2002-12-27 Thread Matt Solnit
===
Bug report -- MySQL v4.06, binary distribution
===

--
Machine specs:
--
Compaq Presario desktop
512 MB RAM
Windows XP Professional SP1


Problem description:

MySQL does not return key information about any column after the first
in a unique multi-column key.  Also, the MUL flag seems to indicate
that the key is non-unique, when in fact it is.

There is an equivalent symptom in the MySQL C API.  In the flags field
of the MYSQL_FIELD structure returned by mysql_fetch_field(), the
MULTIPLE_KEY_FLAG will only be present in the first column. 

-
Test script:
-
mysqlUSE test
mysqlCREATE TABLE mytable (a INT NOT NULL, b INT NOT NULL, c INT NOT
NULL, d INT NOT NULL, PRIMARY KEY (a), UNIQUE KEY (b, c));
mysqlDESCRIBE TABLE mytable;

--
Results:
--
+---+-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
+---+-+--+-+-+---+
| a | int(11) |  | PRI | 0   |   |
| b | int(11) |  | MUL | 0   |   |
| c | int(11) |  | | 0   |   |
| d | int(11) |  | | 0   |   |
+---+-+--+-+-+---+


C test program:


/***
Expected output (according to manual section 8.4.1):

Column `a`: primary=1, unique=0, multiple=0
Column `b`: primary=0, unique=1, multiple=0
Column `c`: primary=0, unique=1, multiple=0
Column `d`: primary=0, unique=0, multiple=0

Actual output:

Column `a`: primary=1, unique=0, multiple=0
Column `b`: primary=0, unique=0, multiple=1
Column `c`: primary=0, unique=0, multiple=0
Column `d`: primary=0, unique=0, multiple=0
***/

#include stdafx.h
#include winsock.h
#include mysql.h
#include stdarg.h
#include stdio.h
#include stdlib.h

MYSQL *db_connect(const char *dbname);
void db_disconnect(MYSQL *db);
void db_do_query(MYSQL *db, const char *query);

const char *server_groups[] = {
  test_libmysqld_SERVER, embedded, server, NULL
};

int main(int argc, char* argv[])
{
  MYSQL *one;

  mysql_server_init(argc, argv, (char **)server_groups);
  one = db_connect(test);

  const char* query = SELECT * FROM mytable;
  mysql_query(one, query);
  MYSQL_RES* res = mysql_store_result(one);
  int numFields = mysql_num_fields(res);
  for (int i = 0; i  numFields; i++)
  {
MYSQL_FIELD* fld = mysql_fetch_field(res);
char* name = strdup(fld-name);
bool isPrimary = ((fld-flags  PRI_KEY_FLAG)  0);
bool isUnique = ((fld-flags  UNIQUE_KEY_FLAG)  0);
bool isMulti = ((fld-flags  MULTIPLE_KEY_FLAG)  0);
printf(column `%s`: primary=%d, unique=%d, multiple=%d\n, name,
isPrimary, isUnique, isMulti);
  }

  mysql_close(one);
  mysql_server_end();

  return 0;
}

static void
die(MYSQL *db, char *fmt, ...)
{
  va_list ap;
  va_start(ap, fmt);
  vfprintf(stderr, fmt, ap);
  va_end(ap);
  (void)putc('\n', stderr);
  if (db)
db_disconnect(db);
  exit(EXIT_FAILURE);
}

MYSQL *
db_connect(const char *dbname)
{
  MYSQL *db = mysql_init(NULL);
  if (!db)
die(db, mysql_init failed: no memory);
  /*
   * Notice that the client and server use separate group names.
   * This is critical, because the server will not accept the
   * client's options, and vice versa.
   */
  mysql_options(db, MYSQL_READ_DEFAULT_GROUP, test_libmysqld_CLIENT);
  if (!mysql_real_connect(db, NULL, NULL, NULL, dbname, 0, NULL, 0))
die(db, mysql_real_connect failed: %s, mysql_error(db));

  return db;
}

void
db_disconnect(MYSQL *db)
{
  mysql_close(db);
} 

---
My contact information:
---
Matt Solnit [EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




style question: drop database in an install script

2002-12-27 Thread David T-G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi, all --

I'm working up the schema for my application and, as you can imagine,
starting over and reloading numerous times :-)  In fact, I intend for the
script to be an install script, run on a new installation of the software
to set things up.

The script starts out

  drop database if exist dbname ;
  create database dbname ; use dbname ;
  create table tablename
  (
...
  ) ;
  ...

to set things up and then continues

  insert into tablename (field,field,field)
( data , data , data ) ,
...
( data , data , data ) ;
  ...

to set up the predefined things (credit card types and so on).

To reload the database and try something new, all I have to do is

  mysql -udroot -p  script.sql

and what was there goes away and is rebuilt fresh.  That's mighty
convenient as I'm building up a table's design and trying it out.

Soo...  When you experienced folks write software that's meant to be
installed from a script or such, do you lead off with a 'drop database'
command, or is that just too dangerous to put in a script and you make
your users clean up any old installation by hand?  This will have to be
run by a root user, so we can figure that this user might have read the
docs and know that he's going to start [over] from scratch, but then,
again, users are users :-)

Meanwhile, is there if/then/else functionailty in SQL so that I can say

  if exist dbname exit some error ;
  create database dbname ;
  ...

and not try to create and populate a database on top of an existing one?
Or is there perhaps a RENAME DATABASE command (I saw RENAME TABLE) so
that I could rename the old one to get it out of the way but not toss it?


TIA  HAND

mysql query,
:-D
- -- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+DPsqGb7uCXufRwARAsp8AKC7BuVdyO7Dl5fkbvEM51o+i/BAEgCeI5iI
dI7HQb5oywLHuZIjLxXYZwY=
=QTHL
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Moving a database accross a platform

2002-12-27 Thread Chimpy
I looked through the documentation, but I couldn't find anything relevant 
to this, so here goes...

I have MySQL with databases running on a Solaris machine, and MySQL with 
different databases running on an Irix machine.  I want to integrate some 
of the databases from the Solaris machine into the Irix machine (as the 
Solaris machine will no longer be used)..  Is there any simple way to do this?


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



altering data structure

2002-12-27 Thread David T-G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi, all --

What's the best way to change your database schema around if you have
data in it?  How do you know when to simply ALTER TABLE and when to dump
the whole thing (perhaps doing specific SELECTs to spit out the data
you'd like to have in the end to be processed by some script that will
make the new table structure)?

I don't have a good example, but suppose I have a few tables with some
fields each and I realize that I should make a new table with data from
some columns of some tables.  What to do?


TIA  HAND  Happy Holidays

mysql query,
:-D
- -- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+DQB2Gb7uCXufRwARAoiYAJ9ImPYzudn5iVy6a2VaxF9hZpT0QQCgm5A8
V9U37FV1f/Xk6VVRbPa8A9I=
=XKu3
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




encryption, access, scripting in a database

2002-12-27 Thread David T-G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi, all --

I have, with the generous help of Michael Babcock, worked out what I
think is a reasonable way to protect the credit card numbers in my
database from improper access.  Basically, only the server (better yet,
some other server) can access the card numbers in the cards table. and
requests from the main database and application are pgp-signed while
returned results are pgp-encrypted.

So can any of this be implemented in the database, or is it all at the
application level with just GRANT privs in the ccard database?


TIA  HAND  Happy Holidays

mysql query,
:-D
- -- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+DQJVGb7uCXufRwARAqkaAKCwpkJKKlbbSfn8NUCfSKNybgL/XwCePXgg
TEgHYbgozvBRqmTbt5+hfZQ=
=IpwO
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Mysql Query request

2002-12-27 Thread Arun Kumar
Dear All,
 I have a table 'X', I want to display the record
 in this table 'X' which has occupied the maximum
 number of bytes, i.e i want a query/queries to
display the record with maximum size. I would also
like to print the
 record size as well.
  
 Any help in this front would be great.
 Arun


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




ORDER dilemma

2002-12-27 Thread Pag

	Hi all,

	I am kinda of a beginner in this mysql thing, so please excuse the dumb 
and amateur question:

	i have a table with several date fields: day, month, year, hour, minute 
and i need to order them by a specific string that includes them, like this:

	year/month/day - hour/minute

	basically i need some select command like this:

	SELECT * FROM NEWS ORDER BY year/month/day - hour/minute DESC LIMIT 10

	How can i do such a thing?

	Thanks.


	Pag



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: ORDER dilemma

2002-12-27 Thread John Coder


Hi all,

I am kinda of a beginner in this mysql thing, so please excuse the dumb
and amateur question:

i have a table with several date fields: day, month, year, hour, minute
and i need to order them by a specific string that includes them, like
this:

year/month/day - hour/minute

basically i need some select command like this:

SELECT * FROM NEWS ORDER BY year/month/day - hour/minute DESC LIMIT 10

How can i do such a thing?

Thanks.

look at:
http://www.mysql.com/doc/en/String_functions.html

John Coder





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: ORDER dilemma

2002-12-27 Thread Dan Nelson
In the last episode (Dec 27), John Coder said:
 
 
   Hi all,
 
   I am kinda of a beginner in this mysql thing, so please excuse the dumb
 and amateur question:
 
   i have a table with several date fields: day, month, year, hour, minute
 and i need to order them by a specific string that includes them, like
 this:
 
   year/month/day - hour/minute
 
   basically i need some select command like this:
 
   SELECT * FROM NEWS ORDER BY year/month/day - hour/minute DESC LIMIT 10

ORDER BY year,month,day,hour,minute

-- 
Dan Nelson
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: scanning for auto increment columns

2002-12-27 Thread Greg Matthews
ok, just answering my own question here.

found it.

describe tablename contains auto_increment in the extra column,
which gives me what I want.

sql,query

- Original Message -
From: Greg Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 28, 2002 8:34 AM
Subject: scanning for auto increment columns


 All,

 I'd like to be able to query MySql using the JDBC driver to determine
which
 tables have auto incremented columns.

 In MSSQL I can retrieve data from the syscolumns and sysobjects tables to
 find out which columns are IDENTITY columns, but have had no luck trying
to
 do something similar in MySql (4.05).

 e.g.

 select so.name, sc.name from syscolumns sc, sysobjects so where sc.autoval
 is not null and so.xtype = 'U' and so.id = sc.id order by 1,2


 I'm extending some J2EE app generator functionality, and so would like to
be
 able to scan a database without knowing beforehand (based on business
 knowledge) which tables have auto incremented columns.

 I've tried:

 1. Going over the java.sql metadata functionality to see if I can query
this
 through the standard java.sql functions.

 2. Searching the MySql manual

 Any help much appreciated.

 Greg.


 sql, query


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




page translation

2002-12-27 Thread Is98
sql,query,queries,smallint


for some reason i have a page in asp just showing code and no actual visual
data. any ideas ?

plz
Charles


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Moving a database accross a platform

2002-12-27 Thread Benjamin Pflugmann
Hi.

On Fri 2002-12-27 at 17:19:26 -0800, [EMAIL PROTECTED] wrote:
 I looked through the documentation, but I couldn't find anything relevant 
 to this, so here goes...
 
 I have MySQL with databases running on a Solaris machine, and MySQL with 
 different databases running on an Irix machine.  I want to integrate some 
 of the databases from the Solaris machine into the Irix machine (as the 
 Solaris machine will no longer be used)..  Is there any simple way to do 
 this?

Look up mysqldump and mysql in the manual. You want to do something
like this:

targethost$ mysqladmin create new_database
targethost$ mysqldump -h oldhost some_database | mysql new_database

HTH,

Benjamin.

-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Bug report: UNIQUE KEY and DESCRIBE TABLE

2002-12-27 Thread Paul DuBois
At 16:44 -0800 12/27/02, Matt Solnit wrote:

===
Bug report -- MySQL v4.06, binary distribution
===

--
Machine specs:
--
Compaq Presario desktop
512 MB RAM
Windows XP Professional SP1


Problem description:

MySQL does not return key information about any column after the first
in a unique multi-column key.  Also, the MUL flag seems to indicate
that the key is non-unique, when in fact it is.


1) Use SHOW KEYS if you want better information about the indexes on
a table.  DESCRIBE (aka SHOW COLUMNS) reports some information about
indexes, but that is not its primary purpose.

2) UNIQUE indexes can in fact hold non-unique values if any of the indexed
columns can be NULL.  (A UNIQUE index is allowed to store multiple NULL
values.)  But you are correct that the index in your particular table
can *not* be non-unique, because neither of the indexed columns can be
NULL.  (A further manifestation of this problem is that UNIQUE indexes
in BDB tables can *never* be non-unique, because BDB allows only one NULL
in a UNIQUE index, in contrast to other table types.)



There is an equivalent symptom in the MySQL C API.  In the flags field
of the MYSQL_FIELD structure returned by mysql_fetch_field(), the
MULTIPLE_KEY_FLAG will only be present in the first column.

-
Test script:
-
mysqlUSE test
mysqlCREATE TABLE mytable (a INT NOT NULL, b INT NOT NULL, c INT NOT
NULL, d INT NOT NULL, PRIMARY KEY (a), UNIQUE KEY (b, c));
mysqlDESCRIBE TABLE mytable;

--
Results:
--
+---+-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
+---+-+--+-+-+---+
| a | int(11) |  | PRI | 0   |   |
| b | int(11) |  | MUL | 0   |   |
| c | int(11) |  | | 0   |   |
| d | int(11) |  | | 0   |   |
+---+-+--+-+-+---+



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Mysql Query request

2002-12-27 Thread Paul DuBois
At 18:38 -0800 12/27/02, Arun Kumar wrote:

Dear All,
 I have a table 'X', I want to display the record
 in this table 'X' which has occupied the maximum
 number of bytes, i.e i want a query/queries to
display the record with maximum size. I would also
like to print the
 record size as well.

 Any help in this front would be great.
 Arun


You'll have to calculate record size yourself based on knowledge
about the types of the columns in the table and the storage occupied
by those types.

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: page translation

2002-12-27 Thread Benjamin Pflugmann
On Fri 2002-12-27 at 23:45:25 -0800, [EMAIL PROTECTED] wrote:
 
 for some reason i have a page in asp just showing code and no actual
 visual data. any ideas ?

Ask in a Microsoft / ASP related forum?

I do not see how your question has anything to do with MySQL, so it's
off-topic here. This list gets more than enough traffic already.

Bye,

Benjamin.

-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




unable to create File DSN

2002-12-27 Thread Robert Citek

Hello all,

Why can I not create a File DSN using MyODBC 2.50.39 on Windows 2000?

I have installed MySQL v3.23.52-max-nt and MyODBC 2.50.39 on a Windows 2000
machine.  While I can create both System and User DSNs, I cannot create a
File DSN.  When I try I get the error message File Data Source was not
saved.

I've checked the FAQ:
  http://www.mysql.com/products/myodbc/faq_3.html#DSN_Types
but haven't found anything related to this.

I'll keep searching other sources.  But if anyone can point me in the right
direction, I'd be thankful.

Regards,
- Robert


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




ADO Error '800a01fb'

2002-12-27 Thread Michael She
Hi all,

I'm getting this error with MyODBC v2.50 and v3.51.  I'm running MySQL v4.06:

Microsoft VBScript runtime error '800a01fb'

An exception occurred: 'open'

/mshe/gallery/picture.asp, line 45


The code for that area is:

strConn = DSN=binaryio;
Set objConn = Server.CreateObject(ADODB.Connection)
objConn.open strConn

set rs = server.createobject(adodb.recordset)
strSQL = SELECT * FROM IMAGES WHERE `ID` =   ID
rs.open strSQL, objConn, 3,1,1

Nothing out of the ordinary... anyone know why I'm getting this error?  Thanks!
--
Michael She  : [EMAIL PROTECTED]
Mobile   : (519) 589-7309
WWW Homepage : http://www.binaryio.com/



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php