Query

2004-03-29 Thread Elly Wisata
Hi *, 

I got 2 statement of query which is related to each other but I am confused
whether I can join them into 1 statement

The first one is:

select A.CustId, max(B.InvoiceNum) as InvoiceNum

from Customer A, CustomerInvoice B

where A.CustId=B.CustId and A.CustStatus='AC' group by A.CustId

 

the results of the query above will be put as $CustId[$a] and
$InvoiceNum[$a] for the following query through a looping process :

select A.CustId, A.CustName, A.CustCompany, A.CustBusName, B.InvoiceNum,
B.CurrentCharge, B.InvoiceStatus, B.UsagePeriod

from Customer A, CustomerInvoice B

where A.CustId=B.CustId  and A.CustId='$CustId[$a]' and
B.InvoiceNum='$InvoiceNum[$a]'

 

Is there a way so I can get the max(B.InvoiceNumber) together with the
record of the Max of InvoiceNum in 1 statement only?

 

Thanks in advance

 

~Elle~

 

 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.642 / Virus Database: 410 - Release Date: 3/24/2004
 


Re: php script for new database and user

2004-03-18 Thread Elly Wisata
Oh, thanks for your information. I used phpMyAdmin b4, but I never noticed
that it makes from php script! Gosh!!!
Thanks for make it straight.
- Original Message -
From: [EMAIL PROTECTED]
To: Bernd Tannenbaum [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 9:45 PM
Subject: Re: php script for new database and user






 Hi,

  -Original Message-
  From: Elly Wisata [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 18, 2004 1:55 AM
  To: [EMAIL PROTECTED]
  Cc: 'BGLefty'
  Subject: RE: php script for new database and user
 
  I don't think php script can create database. But maybe I am wrong.
  If I am, please somebody make it straight.
  Create a database should do it through console or some kind like
  it.

 Well, phpMyAdmin can create databases. And if im not wrong its just a
 bundle of php-scripts.
 So maybe just install phpMyAdmin and create a DB. Iirc u can see the
 commands it does to create.

 ---
 php is only providing an interface to mysql.  If wish to script a database
 creation you can definitely use PHP.  As soon as you authenticate to mysql
 via mysql_connect(host,user,pass) you have the rights of that mysqluser,
 then you can create all the dbs you want through regular SQL, using PHP's
 mysql_query.

 mysql_connect('localhost','root','rootpassword');
 mysql_query('CREATE DATABASE PHP_TEST');
 mysql_select_db('PHP_TEST');
 mysql_query('CREATE TABLE STATEMENT')

 But if you just want to get some datbases created, then it may just be
 easier to use the command line/PHPmyAdmin/MySQLCC/lots of other programs.

 HTH
 jeff
 



 Bernd

 --
 [Zufallssig 9]
 [NightGhost] on AO forum: Perhaps it doesn't take two to make an
 idiotic argument, although you have proven for a fact, that one man
 indeed can make two idiotic arguments.


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







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




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



Sum for time

2004-03-18 Thread Elly Wisata
Hi *,

Can somebody show me how to sum for time, my format is hh:mm:ss, need to do
sum for the time as we usually sum a field with integer type. But I am not
sure sum can use for time format.

Thanks in advance

 

~Elle~

 



RE: php script for new database and user

2004-03-17 Thread Elly Wisata
I don't think php script can create database. But maybe I am wrong. If I am,
please somebody make it straight.
Create a database should do it through console or some kind like it.

~Elle~

-Original Message-
From: W. D. [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 18, 2004 2:31 PM
To: [EMAIL PROTECTED]
Cc: BGLefty
Subject: Re: php script for new database and user

At 11:45 3/17/2004, BGLefty wrote:

Is there a simple php script out there somewhere (or an example of how to
do
it) to create a new database, username and password? I would like to have a
form in a password protected folder on my web site and be able to fill in
those three variables to create a new database on my installation of mysql
on my home computer (be able to do this from my office or another
computer).
It seems like a simple enough thing to do but I have been unable to find
any
examples...

Any help would be appreciated.

Thanks,
BGLefty

Do you have PHPmyAdmin installed?  You can quite a bit of work
fairly easily with it.

Start Here to Find It Fast!T -
http://www.US-Webmasters.com/best-start-page/


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



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



RE: PHP and using mysql_last_id()

2004-03-16 Thread Elly Wisata
Does php have a function like mysql_insert_id but support a zerofill auto
increment int?

~Elle~
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 17, 2004 5:19 AM
To: [EMAIL PROTECTED]
Subject: Re: PHP and using mysql_last_id()



Hi can anyone tell me how to use php's mysql_last_id()  or MySQL's
INSERT_LAST_ID

-
php's function is mysql_insert_id() and not mysql_last_id(), there is no
php function called mysql_last_id()...if you saw that in a manual, i'd
email the owner of the document.


http://php.net/mysql_insert_id
hth
Jeff
_

I have a page registration page, using a username, password and member
level
text box.

I want to send the user (upon successful insert) to a member's detail form
where the password table primary key is avaliable it can be kept and
entered
to subsequent tables as a Foriegn Key.

But when I have tried it all I ever get is a value of 1.

I have looked at the manuals online and found a couple of books that list
these functions, and understand the syntax qnd what it does,

but can not find a working example or inducation as to where it goes etc

any pointers would be much appreciated

stu


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







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



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



query

2004-03-03 Thread Elly Wisata
Hi *,

How to query records that most of the fields are the same value? Izit
possible?

Thanks in advance

 

~Elle~



FW: query

2004-03-03 Thread Elly Wisata

In 1 table, I probably have double records or triple records with the same
value for several fields. 
Example : table customer with field customer_id, address, DOB, Services
I need to know that customer data in my table have more than 1 record for 1
customer. So he/she has more then 1 customer_id. 
I need to query the double record, not the DISTINCT one.
 
~Elle~
-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 04, 2004 10:42 AM
To: Elly Wisata; [EMAIL PROTECTED]
Subject: Re: query

I don't understand your question. And if I don't understand it, there are
probably a lot of others who don't understand it either.

Rhino

- Original Message - 
From: Elly Wisata [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 10:20 PM
Subject: query


 Hi *,

 How to query records that most of the fields are the same value? Izit
 possible?

 Thanks in advance



 ~Elle~




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



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



RE: FW: query

2004-03-03 Thread Elly Wisata
I only have 1 table for this job. Your example is using 2 table.

~Elle~

-Original Message-
From: Joshua J. Kugler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 04, 2004 11:08 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: FW: query

Oh, so what you're looking for a a find duplicates query (as MS Access calls

it).  That's something like this (I'm rusty, so you might have to debug).

SELECT fname, lname, etc FROM my_table as table1, my_table as table2
WHERE table1.fname = table2.fname
AND table1.lname = table2.lname
...etc...
AND table1.customer_id  table2.customer_id

That should give you duplicate rows, or something close to it.

Hope that helps.

j- k-

On Wednesday 03 March 2004 06:51 pm, Elly Wisata wrote:
 In 1 table, I probably have double records or triple records with the same
 value for several fields.
 Example : table customer with field customer_id, address, DOB, Services
 I need to know that customer data in my table have more than 1 record for
1
 customer. So he/she has more then 1 customer_id.
 I need to query the double record, not the DISTINCT one.

 ~Elle~

-- 
Joshua J. Kugler
Fairbanks, Alaska
Computer Consultant--Systems Designer
.--- --- ...  ..- .--.- ..- --. .-.. . .-.
[EMAIL PROTECTED]
ICQ#:13706295
Every knee shall bow, and every tongue confess, in heaven, on earth, and
under 
the earth, that Jesus Christ is LORD -- Count on it!


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



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



help for pdf file

2004-03-01 Thread Elly Wisata
I don't know this related to php subject or mysql subject, but does anybody
knows how to create a pdf file from php  mysql?

Or maybe somebody can show me a url contain about it which is clear. Coz I
found some url discussing about it but quite confusing. Thanks in advance

 

~Elle~

 



RE: help for pdf file

2004-03-01 Thread Elly Wisata
Any rpm version?

~Elle~

-Original Message-
From: Jigal van Hemert [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 5:17 PM
To: [EMAIL PROTECTED]
Subject: Re: help for pdf file

 I don't know this related to php subject or mysql subject, but does
anybody
 knows how to create a pdf file from php  mysql?
http://www.fpdf.org
is a free PHP library which can help you produce pdf files.
You have to write your own functions for formatting tables, etc. but the
actual creation of the pdf file is handled by the library.

Regards, Jigal.



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



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



migration database

2004-02-23 Thread Elly Wisata
Hello 

I would like to ask how to migrate my table in database SQL Server to MYSQL.
The field name and data type mostly are different from the one I've prepared
in MYSQL. Could somebody show me the way or any recommended website which
discussing about this? For additional information, I am using MS SQL Server
Enterprise Manager and MySQL CC. Thanks in advance.

 

Elly