03-05-2006, 09:03 PM
Hi,
Was wondering if any good programmer could help me?
In the database that holds my flights I also have a "user" table. This table holds login info for others, thier FSP rank and some other data.
What I would like to do is when a flight is exported is to also insert the pilots rank to the newly exported flight. Which is to say the script
has to also connect to the "user" table, pull the rank for the "PilotName" that is exporting the flight and update all entries with that Pilots
name. (Update thier rank) This is what I have added to the GetFlight page:
$Name = $_REQUEST['PilotName'];
$connection = mysql_connect ("localhost", "login", "pass");
$query="SELECT * FROM user WHERE CallSign='$Name'";
$result = mysql_db_query ("database", $query);
$Rank = $row["FSPRank"];
$connection = mysql_connect ("localhost", "login", "pass");
$query="SELECT * FROM flights WHERE PilotName='$Name'";
$result = mysql_db_query ("database", $query);
$sql = mysql_query("UPDATE flights SET FSPRank='$Rank' WHERE PilotName='$Name'");
It is not working!! Any ideas would be very helpful. Thanks in advanced.
Was wondering if any good programmer could help me?
In the database that holds my flights I also have a "user" table. This table holds login info for others, thier FSP rank and some other data.
What I would like to do is when a flight is exported is to also insert the pilots rank to the newly exported flight. Which is to say the script
has to also connect to the "user" table, pull the rank for the "PilotName" that is exporting the flight and update all entries with that Pilots
name. (Update thier rank) This is what I have added to the GetFlight page:
$Name = $_REQUEST['PilotName'];
$connection = mysql_connect ("localhost", "login", "pass");
$query="SELECT * FROM user WHERE CallSign='$Name'";
$result = mysql_db_query ("database", $query);
$Rank = $row["FSPRank"];
$connection = mysql_connect ("localhost", "login", "pass");
$query="SELECT * FROM flights WHERE PilotName='$Name'";
$result = mysql_db_query ("database", $query);
$sql = mysql_query("UPDATE flights SET FSPRank='$Rank' WHERE PilotName='$Name'");
It is not working!! Any ideas would be very helpful. Thanks in advanced.
Wayne
FS Passengers Flight Log:
http://www.dcvirtual.com/flightstats.php
VATSIM Stats
http://www.dcvirtual.com/vatstats.php
FS Passengers Flight Log:
http://www.dcvirtual.com/flightstats.php
VATSIM Stats
http://www.dcvirtual.com/vatstats.php