Re: [PHP-DB] calling a column into a popup
That's almost it. I want to populate the menu automatically from the database without having to manually modify the HTML. I believe the below will pull the data but it doesn't modify the menu in HTML. I tried a few things like using the variable name as the same as the co_name but the menu always comes up blank unless I put an option name in the list. it doesn't pass the variable for $co_name in the HTML. thanks, boo From: Johannes Janson [EMAIL PROTECTED] Date: Sun, 22 Apr 2001 21:49:36 +0200 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] calling a column into a popup Hi, let me get this right. What I understood is the following: 1. Your admin page where you enter the information of a company 2. A Page with a drop-down list where all the company names are listed. (These names should then be linked to an information page with more info?) 3. A page where new companies can be added. well the drop-down list you can do with a simple while and a select(html) like this: $result = mysql_query(SELECT companyName FROM companyTable ORDER BY companyName); echo select name=company; while (list($c_name) = mysql_fetch_array($result)) { echo option name=$c_name]$c_name/option; } If this is what you want (what I'm not sure about) I'm glad I understood you. If not supply more detailed information. Cheers Johannes -- 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] calling a column into a popup
becky the code below is spot on (nearly) stick it on a form that calls itself change the option name= to option value= and when you refresh the form $company will contain the comany name. you can also use selected in the folowing manner $regs = pg_Exec($conn, select region_id, region_name from region where .$depdisplay. is not null order by .$depdisplay. ); $numregs = pg_numrows($regs); echo 'nbsp;Regionnbsp;nbsp;select name=reg onChange=document.thisForm.submit()'; echo 'option value=0Choose a Region/option'; for ($s=0; $s$numregs; $s++) { $reglist = pg_fetch_array($regs,$s); echo'option value='.$reglist[region_name].''; print ($region == $reglist[region_name]) ? SELECTED: ; echo ''.$reglist[region_name].'/option'; } echo'/select'; -Original Message- From: Beckie Pack [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 15:29 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] calling a column into a popup That's almost it. I want to populate the menu automatically from the database without having to manually modify the HTML. I believe the below will pull the data but it doesn't modify the menu in HTML. I tried a few things like using the variable name as the same as the co_name but the menu always comes up blank unless I put an option name in the list. it doesn't pass the variable for $co_name in the HTML. thanks, boo From: Johannes Janson [EMAIL PROTECTED] Date: Sun, 22 Apr 2001 21:49:36 +0200 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] calling a column into a popup Hi, let me get this right. What I understood is the following: 1. Your admin page where you enter the information of a company 2. A Page with a drop-down list where all the company names are listed. (These names should then be linked to an information page with more info?) 3. A page where new companies can be added. well the drop-down list you can do with a simple while and a select(html) like this: $result = mysql_query(SELECT companyName FROM companyTable ORDER BY companyName); echo select name=company; while (list($c_name) = mysql_fetch_array($result)) { echo option name=$c_name]$c_name/option; } If this is what you want (what I'm not sure about) I'm glad I understood you. If not supply more detailed information. Cheers Johannes -- 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] calling a column into a popup
So a certain company is previously selected? And then you want to populate the form with the info of the company? to do this link the menu with a onChange action to a display page. But I'm not sure if I get the layout. Could you describe it again? Cheers Johannes Beckie Pack [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That's almost it. I want to populate the menu automatically from the database without having to manually modify the HTML. I believe the below will pull the data but it doesn't modify the menu in HTML. I tried a few things like using the variable name as the same as the co_name but the menu always comes up blank unless I put an option name in the list. it doesn't pass the variable for $co_name in the HTML. thanks, boo -- 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] calling a column into a popup
yup, now i realize it is a form calling itself with a php doc. i feel like a dufus(sp?). i didn't recognize the echo as opposed to print so I didn't see the html coming. learning php, mysql, and database design all together. it's kinda fun, given time for a project you know. thanks to both of you. beckie From: Steve Brett [EMAIL PROTECTED] Date: Mon, 23 Apr 2001 16:02:02 +0100 To: Beckie Pack [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] calling a column into a popup becky the code below is spot on (nearly) stick it on a form that calls itself change the option name= to option value= and when you refresh the form $company will contain the comany name. you can also use selected in the folowing manner $regs = pg_Exec($conn, select region_id, region_name from region where .$depdisplay. is not null order by .$depdisplay. ); $numregs = pg_numrows($regs); echo 'nbsp;Regionnbsp;nbsp;select name=reg onChange=document.thisForm.submit()'; echo 'option value=0Choose a Region/option'; for ($s=0; $s$numregs; $s++) { $reglist = pg_fetch_array($regs,$s); echo'option value='.$reglist[region_name].''; print ($region == $reglist[region_name]) ? SELECTED: ; echo ''.$reglist[region_name].'/option'; } echo'/select'; -Original Message- From: Beckie Pack [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 15:29 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] calling a column into a popup That's almost it. I want to populate the menu automatically from the database without having to manually modify the HTML. I believe the below will pull the data but it doesn't modify the menu in HTML. I tried a few things like using the variable name as the same as the co_name but the menu always comes up blank unless I put an option name in the list. it doesn't pass the variable for $co_name in the HTML. thanks, boo From: Johannes Janson [EMAIL PROTECTED] Date: Sun, 22 Apr 2001 21:49:36 +0200 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] calling a column into a popup Hi, let me get this right. What I understood is the following: 1. Your admin page where you enter the information of a company 2. A Page with a drop-down list where all the company names are listed. (These names should then be linked to an information page with more info?) 3. A page where new companies can be added. well the drop-down list you can do with a simple while and a select(html) like this: $result = mysql_query(SELECT companyName FROM companyTable ORDER BY companyName); echo select name=company; while (list($c_name) = mysql_fetch_array($result)) { echo option name=$c_name]$c_name/option; } If this is what you want (what I'm not sure about) I'm glad I understood you. If not supply more detailed information. Cheers Johannes -- 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] calling a column into a popup
Hi, let me get this right. What I understood is the following: 1. Your admin page where you enter the information of a company 2. A Page with a drop-down list where all the company names are listed. (These names should then be linked to an information page with more info?) 3. A page where new companies can be added. well the drop-down list you can do with a simple while and a select(html) like this: $result = mysql_query("SELECT companyName FROM companyTable ORDER BY companyName"); echo "select name=company"; while (list($c_name) = mysql_fetch_array($result)) { echo "option name=$c_name]$c_name/option"; } If this is what you want (what I'm not sure about) I'm glad I understood you. If not supply more detailed information. Cheers Johannes "Beckie Pack" [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm creating a database where I'd like to relate a company name field to all the field in the database (mysql). what i'm trying to do is have a field pop up with all the current company names in a pop up list on a browser. so, for example, using a form i can enter all the data for a company including name, address, etc. what i'm trying to do is have a popup for the company so if the information is already entered it is there for selection or the person can enter a new company if it's not there. any ideas? thanks, beckie -- 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]