RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén

1. Do query
2. Loop thru query results and write HTML for dropdown

I think you should know atleast the basics of SQL + HTML before asking
stuff here. There are whole lot of tutorials around the net.


Niklas


-Original Message-
From: B.J.Rumsey [mailto:[EMAIL PROTECTED]] 
Sent: 30. tammikuuta 2002 10:18
To: php-db
Subject: [PHP-DB] Drop down list


  I have two fields artist_id, artist. How do I put the contents of
artist into a dropdown list.



  IncrediMail - Email has finally evolved - Click Here


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP-DB] Drop down list

2002-01-30 Thread George Lioumis


- Original Message - 
From: George Lioumis 
To: B.J.Rumsey 
Sent: Wednesday, January 30, 2002 11:47 AM
Subject: Re: [PHP-DB] Drop down list


Try the following:
?php

$option_block = ;
$get_list = select * from table_name;
$res = mysql_query($get_list) or die (mysql_error());

while ($row = mysql_fetch_array($res))
{
$artid= $row[artist_id];
$art = $row[artist];
$option_block .= OPTION value=\$art_id\$art/OPTION;
} 
?

SELECT name=artist
?php echo $option_block; ?
/SELECT

  - Original Message - 
  From: B.J.Rumsey 
  To: php-db 
  Sent: Wednesday, January 30, 2002 10:17 AM
  Subject: [PHP-DB] Drop down list


  I have two fields artist_id, artist. How do I put the contents of artist 
into a dropdown list. 
   
   
  
IncrediMail - Email has finally evolved - Click Here



RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén

Well, true. :)

There is a but: I think it's stupid to try to get the solution from
others while the information is very easy to find by reading the manual.
This issue is about _very_ basic stuff. If you do not know how to loop
your query result, what in earth can you do with it?
This is my point, I don't expect anyone to know everything about SQL, I
don't.

And I do think that I did help in a way, I told this guy what he should
do in case he didn't have any idea where to begin. So he only had to
take the manual and read about query, how to loop it and HTML he should
know. Or again, read some tutorial about it.


Niklas


-Original Message-
From: George Lioumis [mailto:[EMAIL PROTECTED]] 
Sent: 30. tammikuuta 2002 11:50
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Drop down list


I think you should be more polite with newbies. If you don't want to
help someone, just don't answer.


- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-DB [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:33 AM
Subject: RE: [PHP-DB] Drop down list


 1. Do query
 2. Loop thru query results and write HTML for dropdown

 I think you should know atleast the basics of SQL + HTML before asking

 stuff here. There are whole lot of tutorials around the net.


 Niklas


 -Original Message-
 From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
 Sent: 30. tammikuuta 2002 10:18
 To: php-db
 Subject: [PHP-DB] Drop down list


   I have two fields artist_id, artist. How do I put the contents of 
 artist into a dropdown list.


 
   IncrediMail - Email has finally evolved - Click Here


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Drop down list

2002-01-30 Thread Piotrek

OK. Someone else has already answered the question, so you could shut up and
stop teaching us all how to deal with newbies.
This way you'll help in a way

- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-DB [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 12:52 PM
Subject: RE: [PHP-DB] Drop down list


Well, true. :)

There is a but: I think it's stupid to try to get the solution from
others while the information is very easy to find by reading the manual.
This issue is about _very_ basic stuff. If you do not know how to loop
your query result, what in earth can you do with it?
This is my point, I don't expect anyone to know everything about SQL, I
don't.

And I do think that I did help in a way, I told this guy what he should
do in case he didn't have any idea where to begin. So he only had to
take the manual and read about query, how to loop it and HTML he should
know. Or again, read some tutorial about it.


Niklas


-Original Message-
From: George Lioumis [mailto:[EMAIL PROTECTED]]
Sent: 30. tammikuuta 2002 11:50
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Drop down list


I think you should be more polite with newbies. If you don't want to
help someone, just don't answer.


- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-DB [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:33 AM
Subject: RE: [PHP-DB] Drop down list


 1. Do query
 2. Loop thru query results and write HTML for dropdown

 I think you should know atleast the basics of SQL + HTML before asking

 stuff here. There are whole lot of tutorials around the net.


 Niklas


 -Original Message-
 From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
 Sent: 30. tammikuuta 2002 10:18
 To: php-db
 Subject: [PHP-DB] Drop down list


   I have two fields artist_id, artist. How do I put the contents of
 artist into a dropdown list.


 
   IncrediMail - Email has finally evolved - Click Here


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén

I'm not allowed to answer arguments pointed to me?
This is my way of dealing with newbies, and this is what I've learned to
be the most powerfull way to really learn how to do things. If you don't
like it - fine - handle them how you like.


Niklas


-Original Message-
From: Piotrek [mailto:[EMAIL PROTECTED]] 
Sent: 30. tammikuuta 2002 14:36
To: [EMAIL PROTECTED]; Php-DB
Subject: Re: [PHP-DB] Drop down list


OK. Someone else has already answered the question, so you could shut up
and stop teaching us all how to deal with newbies. This way you'll help
in a way

- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-DB [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 12:52 PM
Subject: RE: [PHP-DB] Drop down list


Well, true. :)

There is a but: I think it's stupid to try to get the solution from
others while the information is very easy to find by reading the manual.
This issue is about _very_ basic stuff. If you do not know how to loop
your query result, what in earth can you do with it? This is my point, I
don't expect anyone to know everything about SQL, I don't.

And I do think that I did help in a way, I told this guy what he should
do in case he didn't have any idea where to begin. So he only had to
take the manual and read about query, how to loop it and HTML he should
know. Or again, read some tutorial about it.


Niklas


-Original Message-
From: George Lioumis [mailto:[EMAIL PROTECTED]]
Sent: 30. tammikuuta 2002 11:50
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Drop down list


I think you should be more polite with newbies. If you don't want to
help someone, just don't answer.


- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-DB [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:33 AM
Subject: RE: [PHP-DB] Drop down list


 1. Do query
 2. Loop thru query results and write HTML for dropdown

 I think you should know atleast the basics of SQL + HTML before asking

 stuff here. There are whole lot of tutorials around the net.


 Niklas


 -Original Message-
 From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
 Sent: 30. tammikuuta 2002 10:18
 To: php-db
 Subject: [PHP-DB] Drop down list


   I have two fields artist_id, artist. How do I put the contents of 
 artist into a dropdown list.


 
   IncrediMail - Email has finally evolved - Click Here


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Drop down list

2002-01-30 Thread Rick Emery

First conect to DB
$result=mysql($DBname,SELECT * FROM table;

print SELECT name = artist;
while( list($artist_id,$name) = mysql_fetch_array($result) )
{
print OPTION value=\$artist_id\$name/OPTION\n;
}
print /SELECT;

-Original Message-
From: Julius Dlugolinsky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 8:48 AM
Cc: Php-DB
Subject: RE: [PHP-DB] Drop down list




First conect to DB
$result=mysql($DBname,SELECT * FROM table where 1);
$no=mysql_numrows($result);
$i=0;
$string=;
while ($i$no){
$string.=option
value=\.mysql($result,$i,$artist_id).\.mysql_result($result,$i,arti
st)./option;
$i++;}
$string=select name=artist$string/select;
and in string is drop down menu.

EXO (www.exo.sk)
 


  -Original Message-
  From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
  Sent: 30. tammikuuta 2002 10:18
  To: php-db
  Subject: [PHP-DB] Drop down list
 
 
I have two fields artist_id, artist. How do I put the contents of 
  artist into a dropdown list.
 
 
  
IncrediMail - Email has finally evolved - Click Here
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: 
  [EMAIL PROTECTED]
 
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] drop down list

2002-01-30 Thread Beau Lebens

apologies for answering such an already-over-answered question, but i feel
that no-one has given a particularly *good* answer, so i'll add mine to the
list. I use this function (as well as a couple others which do similar
things for all form elements;

// Creates an HTML select box of values.
// $options can be one or two dimensional, if one then indexes 0+ are used
as values
// $misc contains any key/value pairs you want added to the tag as
attributes, such
// as class, style or multiple attributes.
function display_select($name, $options, $value = 0, $misc = unset) {
$select = select;
if (strlen($name))
$select .=  name=\ . $name . \;
if (is_array($misc))
while (list($id, $val) = each($misc))
$select .=   . $id . =\ . $val . \;
$select .= ;
if (is_array($options)) {
while (list($id, $val) = each($options)) {
$select .= \noption;
$select .=  value=\ . $id . \;
if (strcmp($id, $value))
$select .= ;
else
$select .=  selected;
$select .= htmlspecialchars($val) . /option;
}
}
$select .= \n/select;
return $select;
}




// -Original Message-
// From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 30 January 2002 2:30 PM
// To: php-db
// Subject: [PHP-DB] drop down list
// 
// 
// I have two fields artist_id, artist.  How do I put the 
// contents of artist into a dropdown list.
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] drop down list

2002-01-29 Thread B.J.Rumsey

I have two fields artist_id, artist.  How do I put the contents of artist into a 
dropdown list.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]