I have been looking at this for days now.
I have a drop down menu that get it's values from an sql database That works but now I want to get the item and pass it to another query that's where I get lost or I may have been lost from the start and got lucky.
Here is the code I have
Code: [Select] <form action="" method="post" name="test"></form>
<select name="flt_game" id="flt_game" onChange="document.test.submit();">
<?php
$sql2 = "SELECT Pilot_Number, Pilot_Name FROM Logger_pilots ORDER BY Pilot_Number";
$result2 = $db->
sql_query($sql2);
while ($row = $db->sql_fetchrow($result2)) {
$pilotid = $row[Pilot_Number];
$pilot1 = $row[Pilot_Name];
if ($pilotid == $pilot1) {
$sel = "selected ";
}
echo "<option $sel value="$pilot1">$pilot1</option>
n";
$sel = "";
}
?>
</select>
</form>
<?php
echo "You selected $sel ";
echo "
";
echo "<b>A/A Kill Average By Aircraft `flt_game`</b>
</center>";
$a = 1;
$sql5 = "SELECT Pilot_Name AS pilot , Aircraft AS aircraft1 , round((SUM(Kills) / SUM(Killed))*1,2) AS hrs FROM logger_stats WHERE Pilot_Name = '$pilot1' GROUP BY Pilot_Name, Aircraft ORDER BY hrs DESC LIMIT 0,100";
$result5=sql_query($sql5, $db);
while(list($pilot, $aircraft1, $hrs) = sql_fetch_row($result5, $db)) {
echo "<font color="#CC9900" >$a: $aircraft1 </font><em>($hrs Kills)</em>
";
$a++;
}
Thanks For the Help
Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so I don't quite understand what they're talking about or what the code means.Here's the situation: I
IS this code correct
The reason i ask is everything underneath it appears to be alink as well, tis blimmin annoyingCode: <?php echo '<li class="newproducts"><a
Limiting checkboxes?
Hi guys, I have this code: Code: if(isset($_POST['selected'])) { foreach($_POST['selected'] as $item) { $sql = "SELECT * FROM tablename WHERE ID=$item"; mysql_query($sql) or
PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the password, Any help would be great.. Heres the code, It's suppose to log the username and the password,
big pagination problem in php
<?php$connect = mysql_connect("localhost", "root", "") or die(mysql_error());mysql_select_db("guest") or die(mysql_error());function bbcode($string){
Multiple arrays inside data
Hi,Simple question. I have a column called "array" in my database, and inserted into each field is the following imploded array:Code: mctriangle,570.65,355.1,1,1,0It is an instance of an
Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the return button from my preview view. the information is lost in all the textarea's. Any clue what I
Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaWiki on my site and I'm trying to install some extensions. In order to install the Search
C problem struct and string
Hi guys,This is my first post and I'm hoping the experts here can help me solve my problem.- I'm trying to create a linked list in C and the codes look like this:#include "stdio.h"#include
php not working written for consumption of slots
1. Here is the function where i will be allowed to consume the slot booked by me.2. Here i check the unique reservation id, current server time & date.3. Then i ask the user to enter the