Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Fri Jul 28, 2006 7:19 pm Reply with quote

I have a page I am working on that has a listbox. I want the listbox to populate with all team_id/team_names.

Example:

$nukeusername = $userinfo['username'];

Code:
$sql = "SELECT * FROM " . $prefix . "_eto_divisions WHERE div_commander ='$nukeusername'"; 


The div_commander has a div_id as well as all the rest of the teams on the "Allied" side. div_id = 1

The listbox is supposed to be for selecting any of the teams on the "Axis" side. div_id = 2

For whatever reason I can't get this to work.


Code:
. "               <td width=\"14%\"><p align=\"right\"><b>Enemy Unit: </b></font></td>"

  . "               <td width=\"16%\"><select name=\"team_id\" size=\"1\"><option value=\"\">--- Select Enemy ---</option>";
  //Team List Box for Enemy
  $nukeusername = $userinfo['username']; 
  $mydiv = $db->sql_query("SELECT div_id FROM " . $prefix . "_eto_divisions WHERE div_commander ='$nukeusername'");

 // $mydiv = $db->sql_query("SELECT div_id FROM " . $prefix . "_tc_teams WHERE team_id = '$id'");
 
$result = $db->sql_query("SELECT * FROM " . $prefix . "_tc_teams tct WHERE tct.div_id != $mydiv AND tct.is_active = 1 ORDER BY tct.name");

while ( $row = $db->sql_fetchrow($result) ) {
   $team_name = $row["name"];
   $team_id = $row["team_id"];
   echo "<option value='$team_id'>$team_name</option>";   
}
echo""
  . "         </select>"
 
View user's profile Send private message Visit poster's website ICQ Number
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun Jul 30, 2006 9:57 pm Reply with quote

<bump>

Actually, I appologize in that I am not able to follow the requirement (or maybe it is the problem statement) and the code. I am just not following your "Allied" vs. "Axis". If this is already fixed, let us know. Otherwise, may need a bit more clarity on the functional requirement and translation to the table queries.

Are your queries correctly bringing back the data that you want?

Is it that the drop down list box isn't correctly populating (or rendered in the browser)?

Or, is it that your script that is processing the form is not reading the value that was selected?

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©