mysqldump

2005-04-19 Thread Anna Henricson
Hi,
I have a problem with mysqldump when I want to copy a table from a database.
I have mysql Ver 14.7, Distrib 4.1.9, for pc-linux-gnu.

I use the following command:

mysqldump -h host -u user -ppassword database_name table_name 
table_name.sql


And get the following error message:

mysqldump: mysqldump: Couldn't execute '/*!40100 SET @@SQL_MODE= */':
Query was empty (1065)

I've gotten some reponse that this may be due to a version mismatch between the 
client part and the database. 

The following output is given from the statement below:

mysql SELECT VERSION();
+---+
| VERSION() |
+---+
| 3.23.45   |
+---+
1 row in set (0.00 sec)

Can anyone help me with this problem?
Thanks!

Regards Anna Henricson


---
Anna Henricson, MSc, PhD student
Center for Genomics and Bioinformatics (CGB)
Karolinska Institutet
S-171 77 Stockholm
Sweden
Phone: +46 (0)8 524 86030
Fax: +46 (0)8 323950


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



mysqldump

2005-04-06 Thread Anna Henricson
Hi,
I have a problem with mysqldump when I want to copy a table from a database.
I have mysql Ver 14.7, Distrib 4.1.9, for pc-linux-gnu.

I use the following command:

mysqldump -h host -u user -ppassword database_name table_name 
table_name.sql


And get the following error message:

mysqldump: mysqldump: Couldn't execute '/*!40100 SET @@SQL_MODE= */':
Query was empty (1065)

Can anyone help me with this problem?
Thanks!

Regards Anna Henricson


Anna Henricson, MSc, PhD student
Center for Genomics and Bioinformatics (CGB)
Karolinska Institutet
S-171 77 Stockholm
Sweden
Phone: +46 (0)8 524 86030
Fax: +46 (0)8 323950



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



Re: MySQL Truncated returns

2003-01-30 Thread Anna Noel Leavitt

 Hello all-
 I am using MySql, php and forms in HTML to update information. When I
select results from column type VARCHAR, if the information stored
 in the column has a space in it (for example, Tampa Bay), it will only
 return Tampa (I have the length set at 30 so it is not a length issue).
 I tried changing the column type to text to no avail. I
 searched the documentation and couldn't figure it out. Can someone
 provide some insight for me?
 Thanks-
 Anna




-
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




Reuse MYSQL object instead of multiple connections?

2002-11-20 Thread Anna Fowles-Winkler
Hi,

Currently, my program creates a new MYSQL object each time a connection 
is needed to save or load information from my MySQL database. 
Sometimes, this connection is created 10,000 or more times during one 
use of the program.  I'm wondering if I reuse the connection (have a 
static MYSQL attribute on my database class object) if that would 
improve performance at all?  This is what I'm thinking of doing:

class MyDatabase {
public:
  // various constructors, destructor, and query functions...

private:
 static MYSQL *mysql;
 MYSQL_ROW row;
 MYSQL_RES *result;
};

Then the object is created once for the database that I'm working with 
in the constructor for MyDatabase, and reused for subsequent queries.

Has anyone else tried this?  Any other ways to do this?  I'm using the C 
API and MySQL 3.23.48 on RedHat Linux 7.2.

Thanks,
Anna


-
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: Does mysql_real_connect allocate memory?

2002-11-20 Thread Anna Fowles-Winkler
 Hi,

I tried taking out the new MYSQL, and my application dumps -- it doesn't 
look like mysql_init is actually allocating memory for the MYSQL object 
because then mysql_real_connect is called with a NULL pointer.

Is that supposed to happen?

--Anna

Ben Goodwin wrote:

Hi!
mysql_init will detect if 'mysql' is a NULL pointer or not and allocate
accordingly.  However, your code below doesn't initialize 'mysql' that way,
so your results are undefined.  I'd recommend:

MYSQL *mysql = NULL;

mysql_init (mysql);
mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0);

OR

MYSQL mysql;

mysql_init (mysql);
mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0);

   -=| Ben


- Original Message -
From: Anna Fowles-Winkler [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 19, 2002 2:58 PM
Subject: Does mysql_real_connect allocate memory?


 

Hi,

Does the MySQL C API function mysql_real connect allocate memory or do I
need to do it?  This is what my code currently does:

MYSQL *mysql;
mysql = new MYSQL
mysql_init(mysql);
mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0);

Thanks,
Anna



-
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




Does mysql_real_connect allocate memory?

2002-11-19 Thread Anna Fowles-Winkler
Hi,

Does the MySQL C API function mysql_real connect allocate memory or do I 
need to do it?  This is what my code currently does:

MYSQL *mysql;
mysql = new MYSQL
mysql_init(mysql);
mysql_real_connect(mysql, host, user, password, dbase, 0, 0, 0);

Thanks,
Anna



-
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



Losing data

2002-08-15 Thread Anna Carlsson

Hej

I have several databases with several tables in them and all works fine 
except for one database that loses data.
I'm running mySQL 4.0.1-alpha-nt and the tables are all INNODB. 
The problem is as follows:

Table B references table A by a foreign key. I've filled table A with all the 
data I want and are adding data to table B. After a couple of items, only a 
few of the items are still in the table. Sometimes the other items reappear 
after a couple of minutes, in other cases all items dissapear. Sometimes when 
I run a select statement I get an error message from the table handler error 
code 127. But I have no idea what that means.

Has anyone experienced anything like this!? It's just to weird! I have no 
idea what to do and are ready to give up and export it all to linux and 
postgreSQL instead. 

Anna



This message was sent using SkyBURST Mail Center.
http://www.skyburst.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





Losing data more info

2002-08-15 Thread Anna Carlsson

create table EAP (eapID int auto_increment primary key,
Name varchar(60),
Addr1 varchar(50),
Addr2 varchar(50),
City varchar(30),
State varchar(2), index state_ind(state),
Foreign key (State) references State(StateShort),
Zip varchar(5),
RevisionDate Date,
FundingSource varchar(15),
CEnumber varchar(10),
CompanyContact varchar(150),
Eligibility text,
ProbationaryPeriod text,
Sessions text,
Copay text,
InsuranceInfo text,
RequiredForms text,
Instructions text
) type = innodb;

create table ForCompany (ForCompanyID int auto_increment primary key,
eapID int, index eap_ind(eapID),
Foreign key (eapID) references EAP(eapID),
Name varchar(50)
) type = innodb;

These are the tables. It's table ForCompany that loses data. It doesn't 
really matter what query I run, I've tried a few different. Examples:

1. Select * from ForCompany where eapID = $number;
2. Select * from ForComany;

The result differs from time to time. I have put 10 items in table ForCompany 
and every second time I run query 2 only two items show up, or four, or none 
at all. 
I had the database on mySQL 3.23.36 and upgraded recently to 4.0.1-alpha-nt, 
but nothing changed. I've tried to drop the database and create everything 
from scratch, but that didn't help either.
I couldn't find anything like this in the bug report, and I find it highly 
unlikly that it is a bug. Someone else should have encountered it long ago. 
Is there some kind of property I don't know about? The other 4 database are 
working fine. One of them is in production and I'd like to put the rest in 
production to, but I don't dare do that until I've found out why this db is 
misbehaving. 

Anna




This message was sent using SkyBURST Mail Center.
http://www.skyburst.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: mysql_real_query and escaping a semicolon

2002-04-29 Thread Anna Fowles-Winkler

Gerald Clark wrote:

 The semicolon does not belong there.

Where?  At the end of the query or in the string?

--Anna



 Anna Fowles-Winkler wrote:

 Anna Fowles-Winkler wrote:
 
 Paul DuBois wrote:
 
 Paul DuBois wrote:
 
  At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote:
  Well, the function is called like this:
  
  mysql_real_query( mysql_connection, query_string, strlen( query_string ));
  
  Wouldn't that pass the correct length?
 
  Not necessarily.
 
 Uhm... why not?  Wouldn't strlen return the length of the string, ie, the
 number of characters, and wouldn't that be the length in bytes?
 
 --Anna
 
 Because mysql_real_query() allows the possibility that the query
 string contains binary data (including null bytes), in which case
 strlen() won't necessarily be correct.
 
 *IF* the query string doesn't have anything like that in it,
 then your call should work.  I just find it hard to believe that
 a semicolon would cause any problem.
 
 The query string doesn't have anything binary, and the call doesn't work.  I get a
 syntax error right before the semicolon.
 
 This is my query string:
 INSERT INTO micromodels
  (name, revision, dynamic, m_class, novars, equation, min_0, min_1,
  min_2, min_3, min_4, min_5, min_6, min_7, min_8, max_0, max_1,
  max_2, max_3, max_4, max_5, max_6, max_7, max_8, except_0,
  except_1, except_2, except_3, except_4, except_5, except_6,
  except_7, except_8, prompt_0, prompt_1, prompt_2, prompt_3, prompt_4,
  prompt_5, prompt_6, prompt_7, prompt_8, allow_0, allow_1, allow_2,
  allow_3, allow_4, allow_5, allow_6)
VALUES ('Eye Movement
 
Time',1,NULL,'per',0,'.1;',0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,1);
 
 And I get this error:
 
 You have an error in your SQL syntax near ' '1.' at line 10
 
 Kind of weird.  I tried upping the strlen by 1, and that didn't work either.
 
 Thanks for any suggestions,
 Anna
 
 
 To make it more interesting, I can submit the query into MySQL either thru the 
command line monitor or thru a -e mysql command line call (mysql -uuser
 -ppassword -e query), and it works fine!
 
 --Anna
 
 
 -
 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


-
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_real_query and escaping a semicolon

2002-04-29 Thread Anna Fowles-Winkler

I removed the semicolon from the end of the query string, and I still get the
same syntax error:

You have an error in your SQL syntax near ''.1' at line 10

This is what the query looks like:
INSERT INTO micromodels
 (name, revision, dynamic, m_class, novars, equation, min_0, min_1,
 min_2, min_3, min_4, min_5, min_6, min_7, min_8, max_0, max_1,
 max_2, max_3, max_4, max_5, max_6, max_7, max_8, except_0,
 except_1, except_2, except_3, except_4, except_5, except_6,
 except_7, except_8, prompt_0, prompt_1, prompt_2, prompt_3, prompt_4,
 prompt_5, prompt_6, prompt_7, prompt_8, allow_0, allow_1, allow_2,
 allow_3, allow_4, allow_5, allow_6)
   VALUES ('Eye Movement
Time',1,NULL,'per',0,'.1;',0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,1)



Paul DuBois wrote:

 At 8:37 -0600 4/29/02, Anna Fowles-Winkler wrote:
 Gerald Clark wrote:
 
   The semicolon does not belong there.
 
 Where?  At the end of the query or in the string?
 
 --Anna

 At the end.  Semicolons are perfectly legal in data values (which is
 why this whole episode seems odd), but you don't put them at the
 end of a statement.  That's a convention used by the mysql client
 that you don't follow when using an API directly.

 -
 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




mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler

Hi,

I have an insert command that I'm executing through the C API function
mysql_real_query.  One of my values is a string like this:
'1;'

When mysql_real_query sees the ;, it thinks it's the end of the
statement.  How can I prevent that from happening?  Is there a way to
escape it?

Thanks very much,
Anna
[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: mysql_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler

Well, the function is called like this:

mysql_real_query( mysql_connection, query_string, strlen( query_string ));

Wouldn't that pass the correct length?

--Anna

Paul DuBois wrote:

 At 14:03 -0600 4/26/02, Anna Fowles-Winkler wrote:
 Hi,
 
 I have an insert command that I'm executing through the C API function
 mysql_real_query.  One of my values is a string like this:
 '1;'
 
 When mysql_real_query sees the ;, it thinks it's the end of the
 statement.

 That's unlikely.  I'd guess that you're passing a value for the
 query length parameter that's too low.

How can I prevent that from happening?  Is there a way to
 escape it?
 
 Thanks very much,
 Anna
 [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


-
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_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler

Paul DuBois wrote:

 At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote:
 Well, the function is called like this:
 
 mysql_real_query( mysql_connection, query_string, strlen( query_string ));
 
 Wouldn't that pass the correct length?

 Not necessarily.

Uhm... why not?  Wouldn't strlen return the length of the string, ie, the
number of characters, and wouldn't that be the length in bytes?

--Anna



-
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_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler

Paul DuBois wrote:

 Paul DuBois wrote:
 
   At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote:
   Well, the function is called like this:
   
   mysql_real_query( mysql_connection, query_string, strlen( query_string ));
   
   Wouldn't that pass the correct length?
 
   Not necessarily.
 
 Uhm... why not?  Wouldn't strlen return the length of the string, ie, the
 number of characters, and wouldn't that be the length in bytes?
 
 --Anna

 Because mysql_real_query() allows the possibility that the query
 string contains binary data (including null bytes), in which case
 strlen() won't necessarily be correct.

 *IF* the query string doesn't have anything like that in it,
 then your call should work.  I just find it hard to believe that
 a semicolon would cause any problem.

The query string doesn't have anything binary, and the call doesn't work.  I get a
syntax error right before the semicolon.

This is my query string:
INSERT INTO micromodels
 (name, revision, dynamic, m_class, novars, equation, min_0, min_1,
 min_2, min_3, min_4, min_5, min_6, min_7, min_8, max_0, max_1,
 max_2, max_3, max_4, max_5, max_6, max_7, max_8, except_0,
 except_1, except_2, except_3, except_4, except_5, except_6,
 except_7, except_8, prompt_0, prompt_1, prompt_2, prompt_3, prompt_4,
 prompt_5, prompt_6, prompt_7, prompt_8, allow_0, allow_1, allow_2,
 allow_3, allow_4, allow_5, allow_6)
   VALUES ('Eye Movement
Time',1,NULL,'per',0,'.1;',0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,1);

And I get this error:

You have an error in your SQL syntax near ' '1.' at line 10

Kind of weird.  I tried upping the strlen by 1, and that didn't work either.

Thanks for any suggestions,
Anna



-
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_real_query and escaping a semicolon

2002-04-26 Thread Anna Fowles-Winkler

Anna Fowles-Winkler wrote:

 Paul DuBois wrote:

  Paul DuBois wrote:
  
At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote:
Well, the function is called like this:

mysql_real_query( mysql_connection, query_string, strlen( query_string ));

Wouldn't that pass the correct length?
  
Not necessarily.
  
  Uhm... why not?  Wouldn't strlen return the length of the string, ie, the
  number of characters, and wouldn't that be the length in bytes?
  
  --Anna
 
  Because mysql_real_query() allows the possibility that the query
  string contains binary data (including null bytes), in which case
  strlen() won't necessarily be correct.
 
  *IF* the query string doesn't have anything like that in it,
  then your call should work.  I just find it hard to believe that
  a semicolon would cause any problem.

 The query string doesn't have anything binary, and the call doesn't work.  I get a
 syntax error right before the semicolon.

 This is my query string:
 INSERT INTO micromodels
  (name, revision, dynamic, m_class, novars, equation, min_0, min_1,
  min_2, min_3, min_4, min_5, min_6, min_7, min_8, max_0, max_1,
  max_2, max_3, max_4, max_5, max_6, max_7, max_8, except_0,
  except_1, except_2, except_3, except_4, except_5, except_6,
  except_7, except_8, prompt_0, prompt_1, prompt_2, prompt_3, prompt_4,
  prompt_5, prompt_6, prompt_7, prompt_8, allow_0, allow_1, allow_2,
  allow_3, allow_4, allow_5, allow_6)
VALUES ('Eye Movement
 
Time',1,NULL,'per',0,'.1;',0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,1);

 And I get this error:

 You have an error in your SQL syntax near ' '1.' at line 10

 Kind of weird.  I tried upping the strlen by 1, and that didn't work either.

 Thanks for any suggestions,
 Anna


To make it more interesting, I can submit the query into MySQL either thru the command 
line monitor or thru a -e mysql command line call (mysql -uuser
-ppassword -e query), and it works fine!

--Anna


-
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




How to send multiple SQL statements using C API mysql_query?

2001-11-20 Thread Anna Winkler

Hi,

I would like to send multiple SQL statements using the C
API mysql_query.  I have a large string with 20 SQL statements.  When
I call mysql_query with that string, only the first one is processed.

Is there a way to do what I'm doing without separating the statements
into individual calls to mysql_query?

Thanks in advance for your help,
Anna Winkler
[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




Beginner question - getting last inserted ID

2001-11-09 Thread Anna Ã…hnberg

Hello!

I am working on my first MySQL client. I have a number of tables, each
containing a AUTO_INCREMENT PRIMARY KEY column. The client is built in
Java and using a JDBC-bridge to connect to the database.

When I do an insert in one of these tables the primary key column gets a
new ID. How do I get this ID? I guess I cannot use SELECT MAX(id)
FROM Table since old, deleted id's are reused for new rows.

Please, help me!

Regards,
Anna

-
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




DISTINCT AND NON DISTINCT #2

2001-06-26 Thread anna soobrattee

Hi All,

I've been reading up on how to do joins on the mysql site.

Is there not an inverse function for DISTINCT, so that I can pull out
duplicate data as opposed to DISTINCT data...or will I have to get this
information by using joins?

Thanks very much for your help.

Anna




DISTINCT AND NON DISTINCT

2001-06-25 Thread anna soobrattee

Hi All,

I've been reading up on how to do joins on the mysql site.

Is there not an inverse function for DISTINCT, so that I can pull out
duplicate data as opposed to DISTINCT data...or will I have to get this
information by using joins?

Thanks very much for your help.

Anna




table locking and priorities

2001-06-13 Thread anna soobrattee

Hi All,

Can anyone help me...

My registration form looks up the last username in the members table (select
distinct username from members order by uid desc limit 1), and increments
this username (e.g. from abc2 abc3) which will be used as the
username for the next user to sign up...

the problem occurs when in the time it takes to do an insert, several
selects can take place - so i have the case where there are users with the
same username (which is not very good at all)

Can I force the selects to lock, whilst the insert is taking place?  Has
anyone got any ideas on how to get aorund this ?

Please write back soon!
Anna




Re: where do i get an authcode from ? - PLEASE GET ME UNSUBSCRIBED OFF THIS LIST....

2001-03-26 Thread anna soobrattee

nothing at all i'm afraid..

i think this requires a little shouting ...

PLEASE GET ME UNSUBSCRIBED OFF THIS LIST

thanks

anna

- Original Message -
From: "Brian McDonough" [EMAIL PROTECTED]
To: "anna soobrattee" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, March 21, 2001 10:42 PM
Subject: Re: where do i get an authcode from ?


 I am having trouble too! The AutoResponder/SubScriber seems to be not
working Did you hear anything positive on how to unsubscribe???

 120 emails per day while Traveling on Business is Tooo Much



 At 03:12 PM 3/21/01 -, anna soobrattee wrote:
 please tell how to get an auth code - i want to unsubscribe but i can't
 without an authcode.
 emailing the unsubscribe address doesn't work...i've been trying for
weeks!
 
 thanks
 
 
 -
 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




-
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




http://lists.mysql.com/php/unsubscribe.php

2001-03-26 Thread anna soobrattee

I can't unsubscribe either -

I do not receive an auth code from this page
http://lists.mysql.com/php/unsubscribe.php
after I've entered my email address, so I cannot unsubscribe myself.

If someone  can fix this page, then perhaps, people will stop sending
"unsubscribe me" emails to this list...

anna

- Original Message -
From: "Phillip Vamplew" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: "Arne Claassen" [EMAIL PROTECTED]; "Heikki Tuuri"
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, March 26, 2001 11:48 AM
Subject: RE: Signal 11 on Innobase table range queries


 Please unsubscribe me from the list.
 -Original Message-
 From: Michael Widenius [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 10:35 AM
 To: [EMAIL PROTECTED]
 Cc: Arne Claassen; Heikki Tuuri; [EMAIL PROTECTED]
 Subject: Re: Signal 11 on Innobase table range queries


 Hi!

  "Jeremy" == Jeremy D Zawodny [EMAIL PROTECTED] writes:

 Jeremy On Sun, Mar 25, 2001 at 09:52:22PM -0800, Arne Claassen wrote:
 
  I've got a reproducable signal 11 death in mysqld using Innobase
  tables and range queries (at least reproducable on my machine,
  Redhat 6.2, mysql 3.23.35).
 
  Here's how it manifests itself: Create a table with at least 32
  columns.  Then load a row or two into the table and try to do any
  query using a range (, , between, in) on the primary key and i get
  this:
 
 mysql select * from foo where id  1 limit 1;

 Jeremy [snip]

  Let me know if anyone can reproduce this, as it's quite the
  nuisance...

 Jeremy Yep. I've got a similar result here.

 Jeremy To reproduce you only need one row in the table:

 cut

 Thanks for the test case;  We will fix this shortly and then release
 3.23.36 that will contain the fix for this.

 Regards,
 Monty


 -
 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




-
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? no work on new version MySQL-3.23.33

2001-03-21 Thread anna

Dear Sir,

   problem:
run command mysqld --skip-grant-tables no work, and got error messages

# /usr/sbin/mysqld --skip-grant-tables 
Fatal error: Please read "Security" section of the manual to find out how to run 
mysqld as root!
010322 13:44:51  Aborting


the server is fresh installed with redhat linux6.2 and MySQL-3.23.33.

also I followed the instruction: 20.10 How to Reset a Forgotten Password from 
http://www.mysql.com/doc/R/e/Resetting_permissions.html 

but about half years ago, at the same platform and run  MySQL-3.22.32
these command work very well. 

the /etc/hosts content as below:
127.0.0.1   local   localhost.localdomain localhost
192.168.0.99linux
192.168.0.2 anna


the 192.168.0.99is my local linux server and 192.168.0.2 is windows 98 which I 
used to connect local linux and internet.

any suggestion?

thanks a lot
anna



Re: mysql/php

2001-02-14 Thread Anna

Hi!

- Original Message - 
From: "Martin Cloutier" [EMAIL PROTECTED]
To: "LDL Enterprise" [EMAIL PROTECTED]
Cc: "*MySQL mail list" [EMAIL PROTECTED]
Sent: Wednesday, February 14, 2001 8:58 AM
Subject: Re: mysql/php


 Try this:
 
 $RESULT_SET = mysql_query("SELECT * FROM $table where description LIKE
 '%$keyword%'");
 
 if(!$RESULT_SET){
 $RESULTS = "No records found";
 } else {
 
 do whatever needs to get done!
 }
 
 ...or something similar... (although I did not try it!)
 

I have found this doesn't work. If $RESULT_SET is null or 
equal to nothing, that means that there was a problem 
with the query.
You have to use mysql_num_rows($RESULT_SET) 
to find out if 0 rows were returned.

Anna


-
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: Linking MYSQL to web sites

2001-02-11 Thread Anna

- Original Message -
From: "S MODI" [EMAIL PROTECTED]

 Hi,

 I am, currently a student a final year student studying IT For Business
 at Aston University In Birmingham.
 As part of my final year project I need to produce an online
 questionnaire with database functionailty.

 I have produced an HTML form, but now I need to be able to write the
 answers to the database.

 How do I do this ??
 Can you point me in the right direction for any on-line web sites that
 are available for this kind of tuition.

 Many Thanks

 Sunit


Look around http://www.php.net  and http://www.phpbuilder.com for info on
PHP (a good language for interfacing with databases)
Look around http://www.mysql.com and http://www.devshed.com , among others,
for tutorials and info on using databases.

Anna


-
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: Finding Duplicates and Deleting

2001-02-08 Thread Anna

- Original Message -
From: "Linsen Limsico"

Does anyone know how to find duplicates in a table and deleting them. I
can't figure out how to structure the query.

Linsen

Exact duplicates or where only one field is duplicated?

Anna


-
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




query questions

2001-02-05 Thread Anna

Hi all, 

I have a few questions about query structure.

1. COUNT(*) Is there anything wrong with using 
SELECT COUNT(*) 
FROM bleah 
or should I be using
SELECT COUNT(someField)
FROM bleah

2. Is two queries a lot less efficient than one?
Background: I have a table with about 20 fields of business 
Information. How much information needs to be displayed 
depends on what "packageID" the business has.
So, if I look at all the business is one category, I may get
20,000 records returned. However, only 10 of those may need
all twenty fields returned.
Currently I'm using one query, 
SELECT * 
FROM business 
WHERE categoryID='$categoryID'
LIMIT $pageStart, $pageEnd //this is to only return five records per page

But in one case, where I have to join two tables, the 
temporary table it creates is too big. Would it be a lot 
slower to say:
SELECT *
FROM business 
WHERE categoryID='$categoryID'  packageID='1' 
LIMIT $pageStart, $pageEnd
Display these results, using a counter to keep track of how many 
are returned (in case less than 5 are)
Then do another query
SELECT (here list the fields necessary)
FROM business
WHERE categoryID='$categoryID'  packageID='2'
LIMIT $counter+$pageStart, $pageEnd

Hope this makes sense.

Anna



how do i store complex data in the most efficient way?

2001-01-29 Thread anna soobrattee


hi, i have a query that i hope someone can help me with.

i have a monitoring system that tracks the number of times that person clicks on a 
particular adbanner on our site or in one of our newsletters.  i member can choose 
have a maximum of 16 interests selected.

so for example, i can say i'm interested in carbuying, the stockmarket and action 
movies.  at the moment i store the 16 interests as a bit bitfield,which gets decoded 
on the server.

this system has worked very well for me, but now i have a few new requirements.

- the total number of possible interests that can be selected is now 150
- and i need store the users click rate and the number of times we have sent them a 
newsletter relating to an interest or the number of times we have displayed an 
adbanner related to their interest.

the long ineffient way would be 
- to store 150 enum ("y", "n") fields to say that a user has selected a particular 
interest
- then another 150 tinyint fields to store the response rate
- and another 150 tinyint fields to store the the count of times we have sent a 
newsletter to them 

this already results in 450 fields per record!

the best way i came up with was to store a number like "2_7" to represent 3 things, 
the fact that a user has selected that interest, that the user has responded to 2 of 
our 7 newsletters.

but this is still 150 fields per record.

we have about 250,000 members at the moment - this could get really out of hand very 
quicky.

has anyone got any ideas on the best way to store this information ??

thanks for your help.

anna





large tables?

2001-01-25 Thread anna soobrattee

hi,

i've been asked to design a for a new web-based system which stores lots of data on 
it's members.  There are currently about 500,000 member records.

the problem is that i have to store at least 248 pieces of information on each user.  
i've made the system as relational as possible so that for each user record, i am only 
storing integers, for the most part tinyints and smallints.

Is there a limit on the number of fields per record.  I can easily see this new system 
requiring 300 fields(columns).  what are the consequences for making a table with so 
many columns. this table will be updated very frequently -  will access time degrade 
severely even though i use mainly ints in this table?

thanks for your help.
anna