[PHP-DB] Re: Lotus Notes DB to MySQL?

2004-08-28 Thread Lester Caine
Chris Payne wrote:
I have a client who uses Lotus Notes for her database, now she wants it
converted to MySQL, is that possible?  What format is notes DB in?
Basically I will write a new front-end and back-end for her so she doesn't
need notes anymore (Nasty, nasty software) but I need to import her old data
first.
If memory serves me correctly, you can export from Notes as a CSV text 
file, and then import that. It's been some time since I had to do it, 
but I am sure that was the path I used to get the contacts data into an 
Interbase database.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] [MySQL] Sometimes I get empty rows from SELECT query...

2004-08-28 Thread Michal Pleban
Hello!
I'm writing a PHP script which accesses a MySQL database. As it turns 
out, sometimes I get an empty row from a SELECT query which should 
normally return one or more rows. The same query executed a while later, 
on unchanged data, returns the rows perfectly fine. No errors are 
returned, just mysql_fetch_array simply returns nothing. What can be a 
caouse of this? Perhaps I forgot to put mysql_free_result somewhere, and 
it causes such effects? Anyone had this problem before?

Best regards,
Michau.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Bug with assignment operator ( := )

2004-08-28 Thread Ross Honniball
SQL Statement:
select *,@xtotal := StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08 as total
   from StkMast as sm inner join StkHist as sh using (STkCode)
   where (StkAuthor like 'keller%')
  and (sh.StkhistYear='2004')
  and (@xtotal0);

Notice the use of @xtotal.
I have saved some output from an instance where I ran this query and it 
worked as expected.

Subsequently it has stopped finding any results. (the table has definitly 
NOT changed).
If I take out the and (@xtotal0) clause, it finds records (and, whatsmore, 
I can see that xtotal is indeed greater than zero.

Does anyone know of any erratic behaviour when using the assignment operator?
Or am I doing something wrong?
(Note that this is actually the first time I have ever used the assignment 
operator, so I'm pretty green really)
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Bug with assignment operator ( := )

2004-08-28 Thread Miles Thompson
Ross,
That's correct. From the MyQL manual:
Begin quote ..
In a SELECT statement, each expression is evaluated only when sent to the 
client. This means that in a HAVING, GROUP BY, or ORDER BY clause, you 
cannot refer to an expression that involves variables that are set in the 
SELECT list. For example, the following statement will not work as expected:

mysql SELECT (@aa:=id) AS a, (@aa+3) AS b FROM tbl_name HAVING b=5;
The reference to b in the HAVING clause refers to an alias for an 
expression in the SELECT list that uses @aa. This does not work as 
expected: @aa will not contain the value of the current row, but the value 
of id from the previous selected row.

The general rule is to never assign and use the same variable in the same 
statement.
... end quote

There's more at http://dev.mysql.com/doc/mysql/en/Variables.html
So why not: select *, (StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08) as total
.
. rest of statement ...
.
and total  0

Regards - Miles Thompson
At 10:10 PM 8/28/2004, Ross Honniball wrote:
SQL Statement:
select *,@xtotal := StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08 as total
   from StkMast as sm inner join StkHist as sh using (STkCode)
   where (StkAuthor like 'keller%')
  and (sh.StkhistYear='2004')
  and (@xtotal0);

Notice the use of @xtotal.
I have saved some output from an instance where I ran this query and it 
worked as expected.

Subsequently it has stopped finding any results. (the table has definitly 
NOT changed).
If I take out the and (@xtotal0) clause, it finds records (and, 
whatsmore, I can see that xtotal is indeed greater than zero.

Does anyone know of any erratic behaviour when using the assignment operator?
Or am I doing something wrong?
(Note that this is actually the first time I have ever used the assignment 
operator, so I'm pretty green really)
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Bug with assignment operator ( := )

2004-08-28 Thread Ross Honniball
Myles : Thanks for this info. Clears up that mystery for me.
However, when I try:
So why not: select *, (StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08) as total
.
. rest of statement ...
.
and total  0
I get a
[nativecode=1054 ** Unknown column 'total' in 'where clause']
I had actually tried this before I started playing with assignment statements.
Any clues?
At 11:35 AM 29/08/2004, you wrote:
Ross,
That's correct. From the MyQL manual:
Begin quote ..
In a SELECT statement, each expression is evaluated only when sent to the 
client. This means that in a HAVING, GROUP BY, or ORDER BY clause, you 
cannot refer to an expression that involves variables that are set in the 
SELECT list. For example, the following statement will not work as expected:

mysql SELECT (@aa:=id) AS a, (@aa+3) AS b FROM tbl_name HAVING b=5;
The reference to b in the HAVING clause refers to an alias for an 
expression in the SELECT list that uses @aa. This does not work as 
expected: @aa will not contain the value of the current row, but the value 
of id from the previous selected row.

The general rule is to never assign and use the same variable in the same 
statement.
... end quote

There's more at http://dev.mysql.com/doc/mysql/en/Variables.html
So why not: select *, (StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08) as total
.
. rest of statement ...
.
and total  0

Regards - Miles Thompson
At 10:10 PM 8/28/2004, Ross Honniball wrote:
SQL Statement:
select *,@xtotal := StkhistMonthqty06 + StkhistMonthqty07 + 
StkhistMonthqty08 as total
   from StkMast as sm inner join StkHist as sh using (STkCode)
   where (StkAuthor like 'keller%')
  and (sh.StkhistYear='2004')
  and (@xtotal0);

Notice the use of @xtotal.
I have saved some output from an instance where I ran this query and it 
worked as expected.

Subsequently it has stopped finding any results. (the table has definitly 
NOT changed).
If I take out the and (@xtotal0) clause, it finds records (and, 
whatsmore, I can see that xtotal is indeed greater than zero.

Does anyone know of any erratic behaviour when using the assignment operator?
Or am I doing something wrong?
(Note that this is actually the first time I have ever used the 
assignment operator, so I'm pretty green really)
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Dear php experts

2004-08-28 Thread Bishnu
I am new in PHP. I've just started programming with php. I am going to build a 
newsletter mailing of my own community.
I use a table where members' name, email and other information is stored. I would like 
to send email to all member listed on member table. Could anyone give me functional 
code for it?

Thanks,
Bishnu