Re: problem with count (*) max (*) min (*)

2001-09-07 Thread Peter van Dijk

On Fri, Sep 07, 2001 at 09:28:28AM +0200, Antonio Ortega Sancho wrote:
I'm trying to do select count (*) from table. but it doesn't work
 
 ERROR 1064: You have an error in your SQL syntax near '(*) from pendientes'
 at line 1
 
   Same happens with max (column) and min (column).
 
Do I have to  install anything else or is something wrong. I'm using
 redhat 7.0 with the mysql that comes with this distribution

Try count(*), max(column) and min(column). It probably doesn't accept
the space you put in between there.

Greetz, Peter
-- 
Monopolyhttp://www.dataloss.nl/monopoly.html

-
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: C API mysql client

2001-09-03 Thread Peter van Dijk

On Mon, Sep 03, 2001 at 06:18:34PM +, ahmed wrote:
 please can you give me a cooorect programme source using C APIs
 mysql to acces mysql database

http://www.dataloss.nl/software/dteq/ is such a thing. /plug

Greetz, Peter
-- 
Monopolyhttp://www.dataloss.nl/monopoly.html

-
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@lists.mysql.com: Re: Re: Replication: Push by Master or Pop by Slaves ?]

2001-08-30 Thread Peter van Dijk

On Thu, Aug 30, 2001 at 12:44:46PM +0200, Claudio Cicali wrote:
[snip]
 Here, seems that are the slaves that pop data from master.
 So where is the truth ? Is the master that pushes or the slaves the pops ?
 Or it is a combination of the two ?

In normal operation, the master pushes to the slave. When a slave is
turned off temporarily and is turned back on, it pops all changes that
happened while it was down. After that, the master starts pushing
again.

Magic 5 letter word: MySQL. Tsk.

Greetz, Peter
-- 
Monopolyhttp://www.dataloss.nl/monopoly.html

-
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: check if an index exists?

2001-08-17 Thread Peter van Dijk

On Fri, Aug 17, 2001 at 09:32:05AM -0700, Christopher Teli wrote:
 
 How can I check if an index exists on a table???
 Is there some where I can query the admin tables?

'DESCRIBE tablename' or 'SHOW COLUMNS FROM tablename'. Figure out
where it says 'index' for yourself :) (since I don't know exactly :)

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: WANTED: Utility to reverse engineer existing database

2001-08-06 Thread Peter van Dijk

On Mon, Aug 06, 2001 at 04:57:41PM -0400, Kevin wrote:
 
 I need a utility that will probe my existing mysql database, analyze the 90+
 tables and spit out the data definition language (create table, create
 index, etc.) needed to recreate the database.  Does such a utility exist?

Tried mysqldump? :)

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: Placing directory structure under GNU GPL

2001-07-31 Thread Peter van Dijk

On Tue, Jul 31, 2001 at 06:48:07PM +0400, System Administrator wrote:
 I wonder whether the default directory structure of all future mysql
 releases could also be GPL'led. That would prevent others from placing
 the releases on directories of their own choice.

The GPL does not impose any restrictions, as long as people keep the
source open. Keeping the source of a directory structure open is not
that complicated.

Therefore, it will not help.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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 and credit cards

2001-07-25 Thread Peter van Dijk

On Wed, Jul 25, 2001 at 07:12:17PM +0200, Alexander Skwar wrote:
[snip]
 'encryption'?  Hmm, how about: none?  If you don't need to reconstruct
 the cc#, md5 will be good.

Indeed. That is however rarely the case with credit card numbers.

 However, if you need to reconstruct it, nothing is safe.  And that's
 quite simple:
 a) You need to get access to the MySQL server.  Impossible to do from
 the outside if '--skip-networking' is used.
 b) So, only possible from the localhost.  This means, there must have
 been a break in to the MySQL server.  Once he's on the server, he can do
 anything he likes.  He can also read the source code of your PHP/PERL
 pages.  There the password will be stored, somewhere.  Once the password
 has been found (which is nothing but a matter of time), your encryption
 is broken.

That is only true for a parallel cipher. A non-parallel cipher (like
PGP) allows you to store just the public key on the server, and have
the private key stored somewhere else save, on a way more secured box
that actually handles the transactions.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: Unknown column in 'where clause' error

2001-06-18 Thread Peter van Dijk

On Mon, Jun 18, 2001 at 02:44:00PM -0400, Shrout, Ryan wrote:
 Here is the full error I am getting when running the query included:
 
 Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239
 1054 : Unknown column 'CMET3558539239' in 'where clause'
 Here's the problem, I know that Customer_No exists.  I can see it in the
 database.  This code works fine when using a Customer_No such as 15 or 153,
 something numeric.  The field itself is defined as a CHAR (50).  
 
 Any ideas what is causing this?  It happens with every Customer_No in this
 format and gives the same error.

Try:

SELECT * FROM customers WHERE Customer_No = CMET3558539239;

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: one way encryption for a 16 digits string

2001-06-13 Thread Peter van Dijk

On Wed, Jun 13, 2001 at 02:14:48PM -0700, samuel wrote:
 Hi,
 I need a one way encryption for a 16 digits string.
 let's call $string the clear string, and e($string) the encypted string.
 
 I need e($string) to give always the same result for any $string,
 and I need e($string1) != e ($string2) for all ($string1,$string2),
 having  $string1!= string2.
 
 Does the PASSWORD() built-in function of mysql fits to these
 requirements?

Yes.

 If not, do you know about any other encryption method that would fits to
 that?

encrypt() with a fixed salt.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: Question about order by rand()

2001-06-13 Thread Peter van Dijk

On Wed, Jun 13, 2001 at 03:25:55PM -0600, Matt Heaton wrote:
 I can't seem to find a specificatoin on order by rand() and have a question.
 
 Lets say a table has 10,000 rows in it, and I want to get one row that
 matches
 
 so I do a
 
 select * from table where number=1 order by rand() limit 1;
 
 
 What if 100 rows match?  Does it first get all 100 rows and then randomly
 choose one?

Ofcourse.

 Or does it find the first one and stop?  If it finds 100 rows and then
 chooses one this
 is VERY inefficient.  If it finds one and then stops, what determines which
 row it starts
 searching on?

If it stops at the first one, it can't very well return a random one
from the set. It therefore has to find those 100 entries first.

 If anyone knows FOR SURE how this works please let me know... I need to be
 able to grab
 a single row FAST even if a bunch of rows match.  Let me know if you have
 any ideas.

Let's just say the query is executed from left to right quite nicely.
With indexing on 'number' this should be quite fast, still.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html

-
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: I'm after an mysql_info() example

2001-06-01 Thread Peter van Dijk

On Fri, Jun 01, 2001 at 09:26:08PM +1000, Howard Picken wrote:
 After reading the manual and doing vaious searchs around
 the net, I'm damned if I can work out the syntax for
 mysql_info().
 
 Could anyone give me an example please?

In what programming language?

Greetz, Peter.

-
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: Database (Recursion and Factorials)

2001-05-14 Thread Peter van Dijk

On Mon, May 14, 2001 at 09:32:05AM -0400, lkeeton wrote:
[snip]
 how does it take place. For instance in this example I pass 5 it then gets to 
 the line below and evaluates value = 5 * factorial(5-1)- right there that 
 tells me to call the function again and pass it 4 then when I get to the line 
 right below me $value  = 4 * factorial(4-1). I don't see where the actual 
 calculation takes place 5 * 4 * 3 * 2 = 120. Everytime a number gets passed I 
 feel that somehow what I have done before is gone. Can somebody walk me 
 through this very carefully so I can see what is really going on.

This is far from a MySQL question. Try a perl forum, or any
algorithm's manual.

You need to understand the basics of recursion before you can
understand that bit of code.

Greetz, Peter.

-
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: telnet MySQL

2001-05-14 Thread Peter van Dijk

On Mon, May 14, 2001 at 07:26:44AM -0700, Shtykh Roman wrote:
 When I try to telnet MySQL which uses port 3030 as
 below:
 telnet grdmss57 3030
 I get :
 Trying 163.143.156.38...
 Connected to grdmss57.u-aizu.ac.jp.
 Escape character is '^]'.
 (
 3.23.38jN(xIDWiConnection closed by foreign host.
 What is the possible reason? Is it normal?

This is normal. Don't telnet to your mysqld :)

Greetz, Peter.

-
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 commands from Linux shell

2001-04-21 Thread Peter van Dijk

On Fri, Apr 20, 2001 at 12:03:22PM -0300, Fabio Galarraga wrote:
 Hi to all:
 I have a linux script and I need it can execute some mysql commands.
 Is it possible? If possible, how?

http://www.dataloss.nl/dteq/

(you probably want to disable DEBUGging in the Makefile).

Greetz, Peter.

-
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