Possible bug?

2002-05-22 Thread Robert Vetter

Hello,

I have a problem in an Apache module which connects to MySQL using C 
API for counting banner views and clicks.
This module creates a report table for each day. This table is called 
report_MMDD, where MMDD is the current day. To keep thing 
simple I just make following query first: 

CREATE TABLE IF NOT EXISTS report_MMDD (PRIMARY KEY (banner_id)) 
SELECT id as banner_id,0 as clicks, 0 as views from banners.

This means that a new table is created after the first HTTP request 
after midnight. In all other cases this query should be ignored by 
MySQL server. Right after that this table is updated:

UPDATE report_MMDD set clicks=clicks+1 WHERE banner_id=XXX

or:

UPDATE report_MMDD set views=views+1 WHERE banner_id=XXX


Well, funny things are happening here. After the first request the 
table is created and everything is fine. But when the next one comes 
the table is deleted! MySQL Log file says nothing.
Can somone tell me what's going on?
MySQL Version is 3.23.49 and runs on a Linux system (compiled from 
sources).

Thanks

-- 

Robert Vetter
Internet Application Developer
Kontor23 GmbH
Ottenser Hauptstrasse 56-62
22765 Hamburg
Tel.: 040/380893-14

-
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: Possible bug?

2002-05-22 Thread Robert Vetter

Hi Egor,

Thanks for your reply.


 What table was deleted? report_YYYMMDD?

Yes.

 RV MySQL Log file says nothing.

 Nothing about table delete or nothing about error?

Nope.

Robert Vetter
Internet Application Developer
Kontor23 GmbH
Ottenser Hauptstrasse 56-62
22765 Hamburg
Tel.: 040/380893-14

-
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: Apache + php + MYSQL

2002-05-21 Thread Robert Vetter

On Tuesday 21 May 2002 10:38, Sameer Maggon wrote:
 Hi,
   I have my Database in MYSQL and wanna use PHP on Apache
   At the starting of the page I have given

 ?php
   $query = SELECT * FROM appl;

   // Establish a connection to the MySQL DBMS
   $connection = mysql_connect(linuxsrv, sameer, sameer);
   // Use the rcmms database
   mysql_select_db(rcmms, $connection);

   // Run a query through the connection
   $result = mysql_query($query, $connection);
 ?

  I says that mysql_connect

  Fatal error: Call to undefined function: mysql_connect()
 in /var/www/html/rcmms/appl.php on line 5

Hello,

1. make shure the PHP module is compiled into Apache, or runs as CGI.
2. If you have more questions: Please check following sites first (for 
documntation): www.apache.org, www.php.net, www.mysql.com

Robert Vetter

-
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: Apache + php + MYSQL

2002-05-21 Thread Robert Vetter

On Tuesday 21 May 2002 09:51, Robert Vetter wrote:
 On Tuesday 21 May 2002 10:38, Sameer Maggon wrote:
 in /var/www/html/rcmms/appl.php on line 5

 Hello,

 1. make shure the PHP module is compiled into Apache, or runs as CGI.

rubbish, sorry. Make shure PHP is compiled with MySQL support.

Robert Vetter

-
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 MySQL from an apache module using C API

2002-05-03 Thread Robert Vetter

Hello,

I have problems with connecting to a mysql database. I use a global 
MYSQL handle in the module. The connection is created in 
module_child_init() function and closed in module_child_exit(). It 
seems, that the connection works only for the first request after 
apache has been restarted. After that there is no connection and no new 
connection will be created.
What the module do is to read data from HEAP tables from MySQL in a 
handler function.
Maybe is using global MYSQL handle not a good solution?

Thanks for help.


Robert Vetter
Internet Application Developer
Kontor23 GmbH
Ottenser Hauptstrasse 56-62
22765 Hamburg
Tel.: 040/380893-14

-
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: three tables and count() - Urgent i need it to my job !!

2001-07-05 Thread Robert Vetter



Ireneusz Piasecki wrote:
 
 Hi my friends !!
 
 Some few days i have problems with count().
 i have 3 tables:
 
 t1 holds:
 +++
 | id | number |
 +++
 |  1 | one|
 |  2 | two|
 |  3 | three  |
 |  4 | four   |
 |  5 | five   |
 |  6 | sixs   |
 +++
 
 t2 holds:
 
 ++---+-+
 | id   | id_t1   | t   |
 ++---+-+
 |  1  | 1| 2001-07-03 15:03:34 |
 |  2  | 1| 2001-07-03 15:03:34 |
 |  3  | 1| 2001-07-03 15:03:34 |
 |  4  | 2| 2001-07-03 15:03:34 |
 |  5  | 3| 2001-07-04 12:00:00 |
 |  6  | 3| 2001-07-04 12:00:00 |
 |  7  | 4| 2001-07-04 13:11:00 |
 ++---+-+
 
 t3 have it:
 ++---+-+
 | id | id_t1| t|
 ++---+-+
 |  1 | 1| 2001-07-04 13:11:00 |
 |  2 | 2| 2001-07-04 13:11:00 |
 |  3 | 3| 2001-07-04 13:11:00 |
 |  4 | 1| 2001-07-04 13:11:00 |
 |  5 | 4| 2001-07-04 13:11:00 |
 |  6 | 4| 2001-07-04 13:11:00 |
 |  7 | 4| 2001-07-04 13:11:00 |
 ++--+--+
 
 so, my target is: how many rows there are in table t2 and t3 coresponding to t1.
 Column id_t1 in t2 and t3 are values that are present in t1.id. It is important, it 
must be one query to database.
 
 I make this query:
 
 select t1.id,number,count(t2.id_t1),count(t3.id_t1) from t1
 left join t2 on t2.id_t1=t1.id
 left join t3 on t3.id_t1=t1.id
 group by number order by number desc

Hello,

I don't know what exactly you want to count, but one thing seems to be
obviously to me: You can't make a left join between t2 and t3 on
t3.id_t1=t1.id (line 3 of the query).

Pozdrowienia do Polski,

Robert Vetter

-
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++ for Visual Basic

2001-05-31 Thread Robert Vetter



D'Arcy Rittich wrote:
 
  Actually you dont't need a ocx. You can call the MySQL API functions,
  which are in a dll file.
 
  Robert
 
 Do you have any examples of that with VB?

No, I don't. But you can take a look at an example written in C.

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




Re: MySQL++ for Visual Basic

2001-05-29 Thread Robert Vetter



Cyber Monkey wrote:
 
 Has seen an ocx for the MySQL++ to allow Visual Basic to control MySQL databases?
 

Actually you dont't need a ocx. You can call the MySQL API functions,
which are in a dll file.

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




Re: Help in mySql with Java Applet

2001-05-21 Thread Robert Vetter



Fayed Design wrote:
 
 - Original Message -
 From: Fayed Design
 To: [EMAIL PROTECTED]
 Sent: Friday, May 18, 2001 1:14 PM
 
 Hello to all of you,
 does anybody know how to connect an Java Applet with mySql.I am trying already since 
weeks,no success.
 
 It always response no suitable Driver although I uploaded the driver on the server.

... ON THE SERVER. And where are Java Applets usually execuded? ON THE
CLIENT.
You probably will have to add the JDBC MySQL Driver to Applet, by
creating a JAR File.
Also: Make shure that MySQL Server allows connections from other hosts.

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




Insallation Problem

2001-05-09 Thread robert . vetter

Hello,

I first installed mysql in /usr/local ( just typed ./configure for
configuration). Everythind was fine.
Then I wanted to install mysql in /usr/local/mysql. I deleted all files
from the first installation manually, and typed ./configure
--with-prefix=/usr/local/mysql . Then make and make install as usual.
Now when I try to run mysql_install_db I get this error: Didn't find
/usr/local/libexec/mysqld. You shold do a make install
How can I configure my system, so that mysql knows mysqld is in
/usr/local/mysql/libexec/ now? I use Linux Debian.

Thanks

Robert Vetter

-
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 Manual

2001-04-27 Thread Robert Vetter



Jeremy Zawodny wrote:
 
 On Thu, Apr 26, 2001 at 07:36:34PM -0700, Rodney D. Myers wrote:
 
  Is there a place to purchase the MySQL manual?
 
 The folks at NuSphere will sell you one for $79 or so. You'll get a
 CD, printed manual, and support for the software.

What? I hope you don't mean US-Dollars. If you do - it's much much too
expensive, to express it in a friendly manner.

I just took the PDF manual, burned a CD-ROM and went to a copy shop,
where they printed and binded it.

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




Re: wildcard in tablesearch

2001-04-23 Thread Robert Vetter



Sven Heising wrote:
 
 Hi list,
 
 I'am new in this php and mysql-stuff so i need al lil bit support...
 
 this is my problem:
 $result = mysql_query(select * from $dbtable where $wonach like
 '%$first_name%' );
 
 $wonach is a var which is set in a html form if i want to search one row
 it is no problemselecting works!
 But how to search in all rows? What is the wildcard command?

Hello,

It seems to me you are mixing up the terms row and column. But I
might be wrong.

Anyway, to search all _columns_ in a database you have make a query like
this:

$result = mysql_query(select * from $dbtable where column1 like
'%$first_name%' OR column2 like '%$first_name%' OR column3 ...);

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




Re: Mysql commands from Linux shell

2001-04-20 Thread Robert Vetter



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?

Simply put the SQL commands in a text file. To execute them in the bash
script you use the mysql client program:

mysql -u user -p password the_database  the_sql_commands_file.sql

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




A little bug?

2001-03-15 Thread Robert Vetter

Hello,

I have just had a little problem with a SELECT query like this:

SELECT DATE_FORMAT(Day,"%e.%m.%Y") AS ftag,* from TheTable;

this query returns an SQL error: ERROR 1064: You have an error in your
SQL syntax near '* from TheTable' at line 1

BUT:

SELECT *,DATE_FORMAT(Day,"%e.%m.%Y") AS ftag from TheTable;

this query works.

Is this a bug in the SQL implamentation of MySQL?

Thanks

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




Re: insert + AUTO_INCREMENT

2001-03-05 Thread Robert Vetter



Joris Kluivers wrote:
 
 hi,
 
 i have a problem
 i have a database table created with the statement:
 CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, 
message text, username varchar(100), UNIQUE id (id);
 
 I insert records with:
 INSERT INTO chatmessages (message, username) VALUES ('this is my message', 'joris');
 
 this works fine (for a while), i can insert messages and retreive them with php.
 But after some time i get the error:
 ERROR 1062: Duplicate entry '127' for key 1
 but how can this be because i've set it to AUTO_INCREMENT.

Using field type TINYINT for the id isn't a good idea, because the value
range for this field type is -128 to 127. So is you have more than 128
records, there are no ids left. AUTO_INCREMNT starts at 0.

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




Re: Antwort: boolean type

2001-03-02 Thread Robert Vetter



"Thalis A. Kalfigopoulos" wrote:
 
   Is there a boolean field type (Yes/No; True/False, 1/0)  in MySQL or what is
   closest to the boolean type
 
  ShortInt: 0 == FALSE,  0 == TRUE
  That's how I do it anyway.
 
  Or maybe combine multiple bool fields to one and use binary logic.
 
 Or quoting from http://www.bitbybit.dk/mysqlfaq/faq.html
 
 Q: create a column of type BOOLEAN?
 
 MySQL does not have a boolean type per se. The usual way to create a boolean value, 
is to use the ENUM type:
 mysql CREATE TABLE truths
 - (answer ENUM('true','false') NOT NULL);
 
 (don't forget the NOT NULL clause, or you end up having not two, but three legal 
values for the field.)
 
 You can also use the following hack to define a field which can contain only one of 
two values, namely the empty string ("") or NULL:
 
 mysql CREATE TABLE truths
 - (answer CHAR(0));
 
 The special beauty of the second example is that the data in the field only occupies 
one bit

I don't quite understand this. How is it possible to story an 1-bit
value in a file or memory and use exactly only 1 bit for it? As far as I
know compters can access at least 1 byte-8 bits at one time, not less.
Does MySQL use a special algorithm in this case?

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




Re: boolean type

2001-03-01 Thread Robert Vetter



Blaz Grapar wrote:
 
 Is there a boolean field type (Yes/No; True/False, 1/0)  in MySQL or what is closest 
to the boolean type

ENUM("no","yes")

-
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: Quick C API question

2001-02-27 Thread Robert Vetter



Evan James Dembskey wrote:
 
 Hi,
 
 I have this statement:
 
 res = mysql_query(my_connection, "SELECT * FROM student WHERE studnum =
 31665222");
 

for example something like this:

char query[96]="SELECT * FROM student WHERE studnum=";
int studnum;

studnum=get_studnum();

sprintf(query[36],"%d",studnum); 
res=mysql_query(my_con,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