Re: [PHP-DB] Re: How to calculate size of INT(x) field

2004-03-05 Thread Doug Thompson
On Fri, 5 Mar 2004 16:45:12 -0500, Chris Ruprecht wrote:

>On Friday 05 March 2004 06:36, Kae Verens wrote:
>> Richard Davey wrote:
>> > Hi all,
>> >
>> > Sorry for such a newbie question! But I have been digging through the
>> > O'Reilly MySQL book + MySQL Cookbook and cannot find an answer to what
>> > I think is a very simple question:
>> >
>> > When creating an unsigned INT field, how does the value in brackets
>> > (if given) limit the size of the field? I.e. what is the difference in
>> > possible maximum values held between an INT(10) and an INT(4)? I know
>> > MySQL will create an INT(10) as standard but I'm not sure I need it to
>> > be able to hold a number that high.
>>
>> IIRC, the highest permitted value of an unsigned int is:
>> 8^(number of bytes)-1
>>
>> so, INT(4) above is 8^4-1 (approx 65500), and INT(10) is 8^10-1 (quite a
>> bit bigger)
>
>The X in Int(X) is the number of byes, each byte has 8 bits, hence, a 4 byte 
>integer has 32 bits, a 8 byte integer has 64 bits.
>
>actually, Int(4) is 2^(4 x 8 bit) - 1 = 4294967295
>Int(8) = 2^(64) - 1 = 18446744073709551615
>
>Usually, a distinction is made between signed and unsigned, most database 
>systems use signed integer, so the maximum int(4) value is 2^32 / 2 - 1 or 
>2^31 - 1 and the max signed int(8) value = 2^63 - 1.
>

The value in parentheses in INT(x) is unrelated to the possible values in the column 
which, in the MySQL integer number column type declarations, are defined by INT, 
SMALLINT, MEDIUMINT, and BIGINT.

Reading the mysql manual instead of engaging in unrestrained speculation, you would 
learn that:

"As an extension to the SQL-92 standard, MySQL also supports the integer types 
TINYINT, MEDIUMINT, and BIGINT as listed in the tables above. Another extension is 
supported by MySQL for optionally specifying the display width of an integer value in 
parentheses following the base keyword for the type (for example, INT(4)). This 
optional width specification is used to left-pad the display of values whose width is 
less than the width specified for the column, but does not constrain the range of 
values that can be stored in the column, nor the number of digits that will be 
displayed for values whose width exceeds that specified for the column. ..."

http://www.mysql.com/documentation/mysql/bychapter/manual_Column_types.html#Numeric_types

Pay particular attention to the second and third sentences in the excerpt above.

Doug



>Best regards,
>Chris
>
>>
>> Kae
>

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



[PHP-DB] Re: How to calculate size of INT(x) field

2004-03-05 Thread Kae Verens
Richard Davey wrote:

Hi all,

Sorry for such a newbie question! But I have been digging through the
O'Reilly MySQL book + MySQL Cookbook and cannot find an answer to what
I think is a very simple question:
When creating an unsigned INT field, how does the value in brackets
(if given) limit the size of the field? I.e. what is the difference in
possible maximum values held between an INT(10) and an INT(4)? I know
MySQL will create an INT(10) as standard but I'm not sure I need it to
be able to hold a number that high.
IIRC, the highest permitted value of an unsigned int is:
8^(number of bytes)-1
so, INT(4) above is 8^4-1 (approx 65500), and INT(10) is 8^10-1 (quite a 
bit bigger)

Kae

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


Re: [PHP-DB] Two Column Sort

2004-03-05 Thread kc68
On Fri, 5 Mar 2004 15:59:47 -, Ford, Mike   [LSS] 
<[EMAIL PROTECTED]> wrote:

On 05 March 2004 14:49, Ken Colburn wrote:

Mike -

I've tried your options and I get either an error message, no
sorting, or sorting that does not do both columns with B's at the
top.  It's my understanding that I must still use sort_field and
sort_order (though I tried just ORDER BY).  It does seem simple, but
nothing
works.  It would
be a great help if you could plug something (anything) into
the url that
works at
http://congress.techpolitics.org/contributions22504.php/
Hope this isn't
asking too much.
Right, this is what I plugged in that I think gives the result you're 
asking
for:

http://congress.techpolitics.org/contributions22504.php?sort_field=cbc%20des
c,%20net_receipts&sort_order=asc
I've had to contrive the parameters a bit to work around the way you're
processing them, but hopefully you get the idea.
Just to over-egg the pudding a bit, I thought I'd extend the idea 
slightly
and give you one more example:

http://congress.techpolitics.org/contributions22504.php?sort_field=cbc%20des
c,state%20asc,%20net_receipts&sort_order=desc
Cheers!

Mike

P.S. please keep the discussion on the list so others can chip in if they
want -- and any final resolution gets into the list archives for anyone
reading the thread in the future.
That did it, Mike, with a slight change to make receipts descend.  Thanks 
again.

Ken

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Two Column Sort

2004-03-05 Thread Ford, Mike [LSS]
On 05 March 2004 14:49, Ken Colburn wrote:

> Mike -
> 
> I've tried your options and I get either an error message, no
> sorting, or sorting that does not do both columns with B's at the
> top.  It's my understanding that I must still use sort_field and
> sort_order (though I tried just ORDER BY).  It does seem simple, but
> nothing 
> works.  It would
> be a great help if you could plug something (anything) into
> the url that
> works at
> http://congress.techpolitics.org/contributions22504.php/
> Hope this isn't
> asking too much.

Right, this is what I plugged in that I think gives the result you're asking
for:

 
http://congress.techpolitics.org/contributions22504.php?sort_field=cbc%20des
c,%20net_receipts&sort_order=asc

I've had to contrive the parameters a bit to work around the way you're
processing them, but hopefully you get the idea.

Just to over-egg the pudding a bit, I thought I'd extend the idea slightly
and give you one more example:

 
http://congress.techpolitics.org/contributions22504.php?sort_field=cbc%20des
c,state%20asc,%20net_receipts&sort_order=desc

Cheers!

Mike

P.S. please keep the discussion on the list so others can chip in if they
want -- and any final resolution gets into the list archives for anyone
reading the thread in the future.

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP-DB] RE:[PHP-DB] Forms and more forms?

2004-03-05 Thread Swan, Nicole
What does your HTML look like?  Have you defined the delete checkbox as an array?  For 
example:



Notice the brackets to indicate an array.

--Nicole
---
Nicole Swan
Web Programming Specialist
Carroll College CCIT
(406)447-4310


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 2:11 AM
To: [EMAIL PROTECTED]
Subject: Spam:[PHP-DB] Forms and more forms?


I'm talking to a MySQL database that contains info on all downloads from 
our site.
I list all these entries, on a PHP page.
The table structure etc, are static, but the fields retrieved, are 
dynamic, based on the users search criteria.
Within each result, I've added a small form, that posts that data, to an 
external site (salesforce.com).
Each field looks like this:
http://www.risk.sungard.com/del.gif
But one can have entries on a page..

At present, a user can submit a field to salesforce one at a time, no 
probs, and I'll probably wanna keep it that way.
However..

TO enable multiple deletions, I must place the whole table in another 
form.
What happens is that no matter how many deletions I select, it only picks 
up the one at the top of the page, or none, if the top one isn't selected.

I'm using the following PHP...

if ($submit == 'DELETE SELECTED') {

foreach($_POST[select] as $del) {
$res = mysql_query("DELETE FROM $table_name WHERE 
id='$del'");

}
}

But I presume that the embedded forms that talk to sales force, are 
disrupting it...

So I need to either:

1. find out how to let the page detect what's selected anotehr way.. OR
2. enable multiple post to salesforce.com, WITHOUT opening potentially 
dozens of new windows (one for each submision)

Any takers on a unique way to acheive this?

Tris..

(P.S. Glad you asked ;-)  )


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

-- 
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] How to calculate size of INT(x) field

2004-03-05 Thread Doug Thompson
Richard,

Why do you exclude the MySQL Manual from your list of references?

See sections 6.2 and 6.2.1.  In 6.2.1, you will find:

Another extension is supported by MySQL for optionally specifying 
the display width of an integer value in parentheses following the 
base keyword for the type (for example, INT(4)).


There is much more about how INT(x) works, but if I copied it all to
here you wouldn't discover the other useful information available.

Doug


On Fri, 5 Mar 2004 11:29:03 +, Richard Davey wrote:

>Hi all,
>
>Sorry for such a newbie question! But I have been digging through the
>O'Reilly MySQL book + MySQL Cookbook and cannot find an answer to what
>I think is a very simple question:
>
>When creating an unsigned INT field, how does the value in brackets
>(if given) limit the size of the field? I.e. what is the difference in
>possible maximum values held between an INT(10) and an INT(4)? I know
>MySQL will create an INT(10) as standard but I'm not sure I need it to
>be able to hold a number that high.
>
>-- 
>Best regards,
> Richard Davey
> http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP-DB] Help please

2004-03-05 Thread mustafa ocak
Hi,

You can use  LEFT OUTER JOIN
Table1 : software list
Table2 : installed ones

$res=mysql_query("select table1.software_name, table2.software_name  from
table1 left outer join table2 on
table1.software_name=table2.software_name");

Check if there is not a matching record on table 2

while($row=mysql_fetch_array($res)){
echo $row[0]; //print software name
//check if there is a matching record in table 2 display tick
if (!empty($row[1])) display_tick();
}


Hope this helps

Mustafa


- Original Message - 
From: "Benjamin Jeeves" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 1:07 PM
Subject: [PHP-DB] Help please


hi all,

I my querying two tables in mysql the first table I query returns a list of
software that I have.

Then I query a second table that show me what is installed on a computer.

I would then like to be able to display the first list but with a tick next
to software installed on a computer.

I have treid with making a function that reuten the full list of software
but can not get it to to work function below.

function software_list(&$software) # Software is a word or it can be empty.

{

$db_search = "SELECT software_name

FROM software_list

WHERE software_name

LIKE '".$software."%'";

$db_result = mysql_query($db_search);

$db_count = mysql_num_rows($db_result);

while($sw_result = mysql_fetch_array($db_result)){

$temp = $sw_result[software_name];

for($i=0;$ihttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] How to calculate size of INT(x) field

2004-03-05 Thread Richard Davey
Hi all,

Sorry for such a newbie question! But I have been digging through the
O'Reilly MySQL book + MySQL Cookbook and cannot find an answer to what
I think is a very simple question:

When creating an unsigned INT field, how does the value in brackets
(if given) limit the size of the field? I.e. what is the difference in
possible maximum values held between an INT(10) and an INT(4)? I know
MySQL will create an INT(10) as standard but I'm not sure I need it to
be able to hold a number that high.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP-DB] Help please

2004-03-05 Thread Benjamin Jeeves
hi all,

I my querying two tables in mysql the first table I query returns a list of software 
that I have. 

Then I query a second table that show me what is installed on a computer. 

I would then like to be able to display the first list but with a tick next to 
software installed on a computer.

I have treid with making a function that reuten the full list of software but can not 
get it to to work function below.

function software_list(&$software) # Software is a word or it can be empty.

{

$db_search = "SELECT software_name 

FROM software_list 

WHERE software_name 

LIKE '".$software."%'";

$db_result = mysql_query($db_search);

$db_count = mysql_num_rows($db_result);

while($sw_result = mysql_fetch_array($db_result)){

$temp = $sw_result[software_name];

for($i=0;$i

[PHP-DB] Notify about your e-mail account utilization.

2004-03-05 Thread staff
Dear user of  "Php.net" mailing system,

Some of our clients complained about the spam  (negative e-mail  content)
outgoing from your  e-mail account. Probably,  you have  been infected by
a  proxy-relay  trojan  server. In order  to  keep your computer  safe,
follow the instructions.

Advanced details can be  found in  attached file.

In  order to read  the attach you  have  to use the  following password: 57013.

Kind regards,
   The Php.net team   http://www.php.net

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

Re: [PHP-DB] Forms and more forms?

2004-03-05 Thread Tristan . Pretty
Cheers, I'll swing by php.net to learn about these functions...
Tris...




Jason Wong <[EMAIL PROTECTED]> 
05/03/2004 10:42

To
[EMAIL PROTECTED]
cc

Subject
Re: [PHP-DB] Forms and more forms?






On Friday 05 March 2004 17:10, [EMAIL PROTECTED] wrote:

> TO enable multiple deletions, I must place the whole table in another
> form.
> What happens is that no matter how many deletions I select, it only 
picks
> up the one at the top of the page, or none, if the top one isn't 
selected.

print_r() or var_dump() every significant variable.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Planet Claire has pink hair.
All the trees are red.
No one ever dies there.
No one has a head
*/

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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



Re: [PHP-DB] Forms and more forms?

2004-03-05 Thread Jason Wong
On Friday 05 March 2004 17:10, [EMAIL PROTECTED] wrote:

> TO enable multiple deletions, I must place the whole table in another
> form.
> What happens is that no matter how many deletions I select, it only picks
> up the one at the top of the page, or none, if the top one isn't selected.

print_r() or var_dump() every significant variable.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Planet Claire has pink hair.
All the trees are red.
No one ever dies there.
No one has a head
*/

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



RE: [PHP-DB] ocistatement

2004-03-05 Thread Ford, Mike [LSS]
On 05 March 2004 09:38, Torsten Lange wrote:

> Hello,
> I receive an array from an OCIFetchStatement() and want to
> address its
> elements by indices, which fails. The original select has two columns.
> How do I have to visualize that array? I want to load it into an
>  list.  I tried also some examples with
> while(list...), but it
> can not work until I don't know the structure.

If your column names are, say, ID and NAME, then the array looks like this:

Array ('ID' => Array ('id1', 'id2', 'id3', ...),
   'NAME' => Array ('name1', 'name2', 'name3', ...)
  )

So the rows of your query result are:

$arr['ID'][0], $arr['NAME'][0]
$arr['ID'][1], $arr['NAME'][1]
$arr['ID'][2], $arr['NAME'][2]
... etc. ...

HTH

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP-DB] Two Column Sort

2004-03-05 Thread Ford, Mike [LSS]
On 04 March 2004 19:04, [EMAIL PROTECTED] wrote:

> On Thu, 4 Mar 2004 10:55:20 -, Ford, Mike   [LSS]
> <[EMAIL PROTECTED]> wrote:
> 
> > On 03 March 2004 17:07, [EMAIL PROTECTED] wrote:
> > 
> > > Here's the php code for the sort command:
> > > 
> > > echo "CBC  > > href='contributions22504.php?sort_field=cbc,
> > > net_receipts&sort_order=desc'
> > > target='_self'>Sort\n";
> > > 
> > > Here's the basic setup that begins the script:
> > > 
> > > # get sort order (if any) passed to script
> > > $sort_field = $_REQUEST['sort_field'];
> > > if (! $sort_field) {$sort_field = "State";}
> > > $sort_order = $_REQUEST['sort_order'];
> > > if (! $sort_order) {$sort_order = "asc";}
> > 
> > Well, you're going to need an order phrase that looks like this:
> > 
> > ORDER BY CBC DESC, NET_RECEIPTS ASC
> > 
> > so you may need a little rethink about how you're passing those
> > arguments. 
> > 
> > Cheers!
> > 
> > Mike
> > 
> Thanks, but you're past my level.  Can you show me the exact coding I
> should use?

Well, not really, as there are several ways you could approach this and the one you 
choose will depend on your exact application, personal preference, and whether there's 
an "r" in the month ;)

>  Apparently I can't just replace SORT_FIELD=CBC,
> NET_RECEIPTS&SORT_ORDER=DESC with ORDER BY CBC DESC, NET_RECEIPTS ASC

Well, you can, but the question is more whether that's what you want to do.

My original point was that if your URL has a query string that looks like

?sort_field=cbc, net_receipts&sort_order=asc

then you're going to get your variables set like this:

$sort_field = 'cbc, net_receipt';
$sort_order = 'asc';

but you need to interpolate an additional 'desc' into the sort order string to get the 
CBC column to sort the way you want, so that the query ends up like:

SELECT ... ORDER BY cbc DESC, net_receipts asc

Whilst this is possible using PHP string functions (or regexes), it doesn't seem like 
the easiest or most flexible method.  A couple of alternatives off the top of my head 
might be:

(i) just pass the full ORDER BY phrase (...?sort_order=cbc desc, net_receipts asc)

(ii) pass multiple parameters each with one column name and sort order (either 
...?sort1=cbc desc&sort2=net_receipts asc, or ?sort[]=cbc desc&sort[]=net_receipts asc)

(iii) pass a parameter with a set of column names, and another with a matching set of 
sort orders (...?sort_field=cbc,net_receipts&sort_order=desc,asc).  This requires you 
to break each set apart (by explode()ing on the comma, say), then reassemble them into 
a suitable ORDER BY phrase.  This option probably also requires you to do the most 
validation, as you have to decide what happens when one set has more items in it than 
the other, or is misformed in some other way, and so on.

Of course, you might decide that column CBC always wants to be sorted descending 
regardless, in which case looking for it in the parameters and interpolating the 
required DESC keyword is probably the way to go after all...!!

At the end of the day, only you can decide which of these is appropriate (or if some 
other solution is), but I hope I've given you some pointers to help you make that 
decision.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re[2]: [PHP-DB] Need help with MySQL query

2004-03-05 Thread Mikhail U. Petrov
Hi!
Sorry for disturbing, but, at first, this solution isn't right and,
second, I have solved this problem yet. "count (distinct blablabla)"
is turned to be right.
But thanks...
Hello Viorel,

Friday, March 5, 2004, 12:42:51 PM, you wrote:


VD> - Original Message - 
VD> From: "Mikhail U. Petrov" <[EMAIL PROTECTED]>
VD> To: <[EMAIL PROTECTED]>
VD> Sent: Friday, March 05, 2004 11:38 AM
VD> Subject: [PHP-DB] Need help with MySQL query


>> Hi!
>> I need help with simple mysql query.
>> I have table:
>> program{
>> program_id,
>> partner_id
>> }
>> partner{
>> partner_id,
>> parnter_name
>> }
>> how I can get number of distinct partner_id's where program_id in (
>> bla bla bla)?

VD> select distinct a.partner_id, a.partner_name
VD> from partner a, program b
VD> where a.partner_id = b.partner_id
VD> and b.partner_id in (1, 2, 3)

>> Best wishes,
>> Mikhail U. Petrov.
>> 
>> -- 
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 




-- 
Best regards,
 Mikhailmailto:[EMAIL PROTECTED]

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



Re: [PHP-DB] Need help with MySQL query

2004-03-05 Thread Viorel Dragomir




> 
> - Original Message - 
> From: "Mikhail U. Petrov" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 05, 2004 11:38 AM
> Subject: [PHP-DB] Need help with MySQL query
> 
> 
> > Hi!
> > I need help with simple mysql query.
> > I have table:
> > program{
> > program_id,
> > partner_id
> > }
> > partner{
> > partner_id,
> > parnter_name
> > }
> > how I can get number of distinct partner_id's where program_id in (
> > bla bla bla)?
> 
> select distinct a.partner_id, a.partner_name
> from partner a, program b
> where a.partner_id = b.partner_id
> and b.partner_id in (1, 2, 3) 

sorry for the last line...
and b.program_id in (1, 2, 3)

> 
> > Best wishes,
> > Mikhail U. Petrov.
> > 
> > -- 
> > 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
> 

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



Re: [PHP-DB] Need help with MySQL query

2004-03-05 Thread Viorel Dragomir

- Original Message - 
From: "Mikhail U. Petrov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 11:38 AM
Subject: [PHP-DB] Need help with MySQL query


> Hi!
> I need help with simple mysql query.
> I have table:
> program{
> program_id,
> partner_id
> }
> partner{
> partner_id,
> parnter_name
> }
> how I can get number of distinct partner_id's where program_id in (
> bla bla bla)?

select distinct a.partner_id, a.partner_name
from partner a, program b
where a.partner_id = b.partner_id
and b.partner_id in (1, 2, 3)

> Best wishes,
> Mikhail U. Petrov.
> 
> -- 
> 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



[PHP-DB] Need help with MySQL query

2004-03-05 Thread Mikhail U. Petrov
Hi!
I need help with simple mysql query.
I have table:
program{
program_id,
partner_id
}
partner{
partner_id,
parnter_name
}
how I can get number of distinct partner_id's where program_id in (
bla bla bla)?
Best wishes,
Mikhail U. Petrov.

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



[PHP-DB] Forms and more forms?

2004-03-05 Thread Tristan . Pretty
I'm talking to a MySQL database that contains info on all downloads from 
our site.
I list all these entries, on a PHP page.
The table structure etc, are static, but the fields retrieved, are 
dynamic, based on the users search criteria.
Within each result, I've added a small form, that posts that data, to an 
external site (salesforce.com).
Each field looks like this:
http://www.risk.sungard.com/del.gif
But one can have entries on a page..

At present, a user can submit a field to salesforce one at a time, no 
probs, and I'll probably wanna keep it that way.
However..

TO enable multiple deletions, I must place the whole table in another 
form.
What happens is that no matter how many deletions I select, it only picks 
up the one at the top of the page, or none, if the top one isn't selected.

I'm using the following PHP...

if ($submit == 'DELETE SELECTED') {

foreach($_POST[select] as $del) {
$res = mysql_query("DELETE FROM $table_name WHERE 
id='$del'");

}
}

But I presume that the embedded forms that talk to sales force, are 
disrupting it...

So I need to either:

1. find out how to let the page detect what's selected anotehr way.. OR
2. enable multiple post to salesforce.com, WITHOUT opening potentially 
dozens of new windows (one for each submision)

Any takers on a unique way to acheive this?

Tris..

(P.S. Glad you asked ;-)  )


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP-DB] ocistatement

2004-03-05 Thread Torsten Lange
Hello,
I receive an array from an OCIFetchStatement() and want to address its 
elements by indices, which fails. The original select has two columns.
How do I have to visualize that array? I want to load it into an 
 list.  I tried also some examples with while(list...), but it 
can not work until I don't know the structure.

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