Help with inserting data into sql from form

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Help with inserting data into sql from form
Houdini_pax
CZ Newbie
Houdini_pax has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 27, 2005
0.00 posts per day
Posts: 3
Points: 631
   
Looking for some help trying to upload user data to table but it not working. I am New to PHP but from what I read this should work. Can anyone point me to my problem?

Thanks for your Help
Houdini




<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* Based on Journey Links Hack                                          */
/* Copyright (c) 2000 by James Knickelbein                              */
/* Journey Milwaukee (http://www.journeymilwaukee.com)                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

/* Upload feature added by Alessio Ruzza - [ Register or login to view links on this board. ]           */


if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index = 1;
//First create a file to store the hits. Make sure this file has write permission
$counternum = "counternum.txt";
//Open the file and write the current hits plus one.
function displayCounter($counternum) {
     $fp = fopen($counternum,rw);
     $num = fgets($fp,9999);
     fclose($fp);
     $fp = fopen($counternum,w);
     $num += 1;
     print "$num";
     fputs($fp, $num);
     fclose($fp);
}
//Display the Current Hits
      ;
global $prefix, $user, $cookie, $db, $module_name;
    include ("header.php");
    echo "<br>";
     OpenTable();
    echo "<center><font class=\"title\"><b>"._LOG."</b></font><br><br>";
    echo "<font class=\"content\"><i>"._LOGPAGE."</i></font></center><br>";
    CloseTable();
    echo "<br>";
     OpenTable();
      echo "<center><font class=\"content\"><b>Flight Log Id</b></font><br><br>";
    echo "<font class=\"content\"><u>".displayCounter($counternum)."</u></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) getusrinfo($user);
       echo "<b>"._PILOT.":</b> ";
    if (is_user($user)) {
        cookiedecode($user);
        echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\"></font>"
        ."<br><br>";
  }
  echo "<p><form action='index.php' method='post'>";
  echo "<b>"._ID." ;; ;; ;; ;; ;</b>"
        ."<input type=\"text\" name=\"logid\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
   echo "<b>"._PILOT." ; </b><select name=\"pilot\">";
            $sql1 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result1 = $db->sql_query($sql1);
            while ($row = $db->sql_fetchrow($result1)) {
            $pilotid = $row[p_id];
            $pilot = $row[p_pilot];
            if ($pilotid == $pilot) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._SELECTHOST." ; </b><select name=\"host\">";
            $sql1 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result1 = $db->sql_query($sql1);
            while ($row = $db->sql_fetchrow($result1)) {
            $pilotid = $row[p_id];
            $pilot = $row[p_pilot];
            if ($pilotid == $pilot) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._MISSION." ;</b> <select name=\"mission\">";
        $sql = "SELECT  ms_id, ms_mission  FROM ".$prefix."_flt_mission ORDER BY ms_id";
        $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
            $msid = $row[ms_id];
            $mission = $row[ms_mission];
            if ($msid == $mission) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$msid\">$mission</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._HRS." ;</b> <select name=\"hrs\">";
        $sql = "SELECT  hr_id, hr_time  FROM ".$prefix."_flt_hrs ORDER BY hr_id";
        $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
            $hrid = $row[hr_id];
            $hrtime = $row[hr_time];
            if ($hrid == $hrtime) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$hrid\">$hrtime</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._AA." ;</b>"
        ."<input type=\"text\" name=\"aakills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._AG." ;</b>"
        ."<input type=\"text\" name=\"agkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._SK." ;</b>"
        ."<input type=\"text\" name=\"shipkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
        echo  "<b>"._LT." ;</b>"
        ."<input type='radio' name='landtakeoff' value='1' checked>"._YES."  ;;
        <input type='radio' name='landtakeoff' value='0'>"._NO."<br><br>";
         "<br><br>";
      echo "<b>"._CT." ;</b>"
        ."<input type='radio' name='carriertakeoff' value='1' checked>"._YES."  ;;
        <input type='radio' name='carriertakeoff' value='0'>"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._FL." ;</b>"
    ."<input type='radio' name='fieldlanding' value='1' checked>"._YES."  ;;
        <input type='radio' name='fieldlanding' value='0'>"._NO."<br><br>";
           "<br><br>";
    echo "<b>"._CL." ;</b>"
    ."<input type='radio' name='carrierlanding' value='1' checked>"._YES."  ;;
        <input type='radio' name='carrierlanding' value='0'>"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._CD." ;</b>"
    ."<input type='radio' name='crasheddead' value='1' checked>"._YES."  ;;
        <input type='radio' name='crasheddead' value='0'>"._NO."<br><br>";
         "<br><br>";
    echo  "<b>"._CW." ;</b>"
    ."<input type='radio' name='crashedwalk' value='1' checked>"._YES."  ;;
        <input type='radio' name='crashedwalk' value='0'>"._NO."<br><br>";
           "<br><br>";
    echo  "<b>"._WON." ;</b>"
    ."<input type='radio' name='won' value='1' checked>"._YES."  ;;
        <input type='radio' name='won' value='0'>"._NO."<br><br>";
            "<br><br>";
    echo  "<b>"._LOST." ;</b>"
    ."<input type='radio' name='lost' value='1' checked>"._YES."  ;;
        <input type='radio' name='lost' value='0'>"._NO."<br><br>";
        echo "<input type='hidden' name='op' value='ConfigSave'>"
        ."<center><input type='submit' value='"._SAVECHANGES."'></center>"
        ."</form>";
    CloseTable();
    include("footer.php");

switch($op) {

    case "ConfigSave":
    global $prefix, $db;
    $db->sql_query("INSERT INTO".$prefix."_flt_log VALUES host='$flt_host', date='$flt_date', time='$flt_time', shipkils='$flt_skills', mission='$flt_mission', pilot='$flt_pilot', hrs='$flt_hrs', aakills='$flt_aa_kills', agkills='$flt_ag_kills', carriertakeoff='$flt_car_to', landtakeoff='$flt_field_to', carrierlanding='$flt_traps', fieldlanding='$flt_field_landing', crasheddead='$flt_crash_die', crashedwalk='$flt_crash_walk', won='$flt_won', lost='$flt_lost'");
    break;
}
?>



Back to top Reply with quote
#2   re: Help with inserting data into sql from form
gotcha
CZ Newbie
 Codezwiz Site Donator
gotcha has been a member for over 19 year's 19 Year Member
usa.gif
Gender: Male
Website:
Status: Offline
Joined: Feb 22, 2005
0.00 posts per day
Posts: 11
Points: 1,117
   
try changing this line

echo "<p><form action='index.php' method='post'>";


to this

echo "<p><form action='modules.php?name=$module_name' method='post'>";



Back to top Reply with quote
#3   re: Help with inserting data into sql from form
Houdini_pax
CZ Newbie
Houdini_pax has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 27, 2005
0.00 posts per day
Posts: 3
Points: 631
   
Thanks but no go
tried this but still can not get it to post to sql


<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* Based on Journey Links Hack                                          */
/* Copyright (c) 2000 by James Knickelbein                              */
/* Journey Milwaukee (http://www.journeymilwaukee.com)                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/




if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index = 1;
//First create a file to store the hits. Make sure this file has write permission
$counternum = "counternum.txt";
//Open the file and write the current hits plus one.
function displayCounter($counternum) {
     $fp = fopen($counternum,rw);
     $num = fgets($fp,9999);
     fclose($fp);
     $fp = fopen($counternum,w);
     $num += 1;
     print "$num";
     fputs($fp, $num);
     fclose($fp);
}
//Display the Current Hits
      ;

global $prefix, $user, $cookie, $db, $module_name;
    include ("header.php");
            if  ($submit) {
        $sql8 = "INSERT INTO".$prefix."_flt_log (flt_host,flt_lod_id,flt_mission,flt_pilot,flt_hrs,flt_aa_kills,flt_ag_kills,flt_car_to,flt_field_to,flt_traps,flt_field_landing,flt_crash_die,flt_crash_walk,flt_won,flt_lost,flt_skills) VALUES ('$host','$logid','$mission','$pilot','$hrs','$aakills','$agkills','$carriertakeoff','$landtakeoff','$carrierlanding','$fieldlanding','$crasheddead','$crashedwalk','$won','$lost','$shipkills')";
          $result8 = $db->sql_query($sql8);
}
    echo "<br>";
     OpenTable();
    echo "<center><font class=\"title\"><b>"._LOG."</b></font><br><br>";
    echo "<font class=\"content\"><i>"._LOGPAGE."</i></font></center><br>";
    CloseTable();
    echo "<br>";
     OpenTable();
      echo "<center><font class=\"content\"><b>Flight Log Id</b></font><br><br>";
    echo "<font class=\"content\"><u>".displayCounter($counternum)."</u></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) getusrinfo($user);
       echo "<b>"._PILOT.":</b> ";
    if (is_user($user)) {
        cookiedecode($user);
        echo "<a href=\"modules.php?name=Your_Account\">$cookie[1]</a> <font class=\"content\"></font>"
        ."<br><br>";
  }
  echo "<p><form action=\"modules.php?name=$module_name\" method=\"post\">";
  echo "<b>"._ID."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp</b>"
        ."<input type=\"text\" name=\"logid\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
   echo "<b>"._PILOT."&nbsp </b><select name=\"pilot\">";
            $sql1 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result1 = $db->sql_query($sql1);
            while ($row = $db->sql_fetchrow($result1)) {
            $pilotid = $row[p_id];
            $pilot = $row[p_pilot];
            if ($pilotid == $pilot) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._SELECTHOST."&nbsp </b><select name=\"host\">";
            $sql2 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result2 = $db->sql_query($sql2);
            while ($row = $db->sql_fetchrow($result2)) {
            $pilotid = $row[p_id];
            $pilot = $row[p_pilot];
            if ($pilotid == $pilot) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._MISSION."&nbsp</b> <select name=\"mission\">";
        $sql3 = "SELECT  ms_id, ms_mission  FROM ".$prefix."_flt_mission ORDER BY ms_id";
        $result3 = $db->sql_query($sql3);
            while ($row = $db->sql_fetchrow($result3)) {
            $msid = $row[ms_id];
            $mission1 = $row[ms_mission];
            if ($msid == $mission1) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$msid\">$mission1</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._HRS."&nbsp</b> <select name=\"hrs\">";
        $sql4 = "SELECT  hr_id, hr_time  FROM ".$prefix."_flt_hrs ORDER BY hr_id";
        $result4 = $db->sql_query($sql4);
            while ($row = $db->sql_fetchrow($result4)) {
            $hrid = $row[hr_id];
            $hrtime = $row[hr_time];
            if ($hrid == $hrtime) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$hrid\">$hrtime</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._AA."&nbsp</b>"
        ."<input type=\"text\" name=\"aakills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._AG."&nbsp</b>"
        ."<input type=\"text\" name=\"agkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._SK."&nbsp</b>"
        ."<input type=\"text\" name=\"shipkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
        echo  "<b>"._LT."&nbsp</b>"
        ."<input type=\"radio\" name=\"landtakeoff\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"landtakeoff\" value=\"0\">"._NO."<br><br>";
         "<br><br>";
      echo "<b>"._CT."&nbsp</b>"
        ."<input type=\"radio\" name=\"carriertakeoff\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"carriertakeoff\" value=\"0\">"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._FL."&nbsp</b>"
    ."<input type=\"radio\" name=\"fieldlanding\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"fieldlanding\" value=\"0\">"._NO."<br><br>";
           "<br><br>";
    echo "<b>"._CL."&nbsp</b>"
    ."<input type=\"radio\" name=\"carrierlanding\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"carrierlanding\" value=\"0\">"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._CD."&nbsp</b>"
    ."<input type=\"radio\" name=\"crasheddead\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"crasheddead\" value=\"0\">"._NO."<br><br>";
         "<br><br>";
    echo  "<b>"._CW."&nbsp</b>"
    ."<input type=\"radio\" name=\"crashedwalk\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"crashedwalk\" value=\"0\">"._NO."<br><br>";
           "<br><br>";
    echo  "<b>"._WON."&nbsp</b>"
    ."<input type=\"radio\" name=\"won\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"won\" value=\"0\">"._NO."<br><br>";
            "<br><br>";
    echo  "<b>"._LOST."&nbsp</b>"
    ."<input type=\"radio\" name=\"lost\" value=\"1\" checked>"._YES." &nbsp;
        <input type=\"radio\" name=\"lost\" value=\"0\">"._NO."<br><br>";
    echo "<center><input type=\"submit\" value=\""._SAVECHANGES."\"'></center>"
        ."</form>";
    if  ($submit) {
        $sql8 = "INSERT INTO".$prefix."_flt_log (flt_host,flt_lod_id,flt_mission,flt_pilot,flt_hrs,flt_aa_kills,flt_ag_kills,flt_car_to,flt_field_to,flt_traps,flt_field_landing,flt_crash_die,flt_crash_walk,flt_won,flt_lost,flt_skills) VALUES ('$host','$logid','$mission','$pilot','$hrs','$aakills','$agkills','$carriertakeoff','$landtakeoff','$carrierlanding','$fieldlanding','$crasheddead','$crashedwalk','$won','$lost','$shipkills')";
          $result8 = $db->sql_query($sql8);
}
    CloseTable();
    include("footer.php");

?>



Back to top Reply with quote
#4   re: Help with inserting data into sql from form
gotcha
CZ Newbie
 Codezwiz Site Donator
gotcha has been a member for over 19 year's 19 Year Member
usa.gif
Gender: Male
Website:
Status: Offline
Joined: Feb 22, 2005
0.00 posts per day
Posts: 11
Points: 1,117
   
try changing this


   $sql8 = "INSERT INTO".$prefix."_flt_log (flt_host,flt_lod_id,flt_mission,flt_pilot,flt_hrs,flt_aa_kills,flt_ag_kills,flt_car_to,flt_field_to,flt_traps,flt_field_landing,flt_crash_die,flt_crash_walk,flt_won,flt_lost,flt_skills) VALUES ('$host','$logid','$mission','$pilot','$hrs','$aakills','$agkills','$carriertakeoff','$landtakeoff','$carrierlanding','$fieldlanding','$crasheddead','$crashedwalk','$won','$lost','$shipkills')";
          $result8 = $db->sql_query($sql8);


to this


   $sql8 = "INSERT INTO ".$prefix."_flt_log  VALUES ('$host', '$logid', '$mission', '$pilot', '$hrs', '$aakills', '$agkills', '$carriertakeoff' ,'$landtakeoff', '$carrierlanding', '$fieldlanding', '$crasheddead', '$crashedwalk', '$won', '$lost', '$shipkills')";
          $result8 = $db->sql_query($sql8);



Back to top Reply with quote
#5   re: Help with inserting data into sql from form
Houdini_pax
CZ Newbie
Houdini_pax has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 27, 2005
0.00 posts per day
Posts: 3
Points: 631
   
Not sure what I am doing wrong here I put your code in with no luck. icon_cry.gif So I will post everything I have done maybe that will help more.

Thank you for your help driving me nuts icon_mad.gif

index.php

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/




if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index = 1;
//First create a file to store the hits. Make sure this file has write permission
$counternum = "counternum.txt";
//Open the file and write the current hits plus one.
function displayCounter($counternum) {
     $fp = fopen($counternum,rw);
     $num = fgets($fp,9999);
     fclose($fp);
     $fp = fopen($counternum,w);
     $num += 1;
     print "$num";
     fputs($fp, $num);
     fclose($fp);
}
//Display the Current Hits
      ;

global $prefix, $user, $cookie, $db, $module_name;
    include ("header.php");
    echo "<br>";
     OpenTable();
    echo "<center><font class=\"title\"><b>"._LOG."</b></font><br><br>";
    echo "<font class=\"content\"><i>"._LOGPAGE."</i></font></center><br>";
    CloseTable();
    echo "<br>";
     OpenTable();
      echo "<center><font class=\"content\"><b>Flight Log Id</b></font><br><br>";
    echo "<font class=\"content\"><u>".displayCounter($counternum)."</u></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) getusrinfo($user);
       echo "<b>"._PILOT.":</b> ";
    if (is_user($user)) {
        cookiedecode($user);
        echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\"></font>"
        ."<br><br>";
  }
  echo "<p><form action=\"modules.php?name=$module_name\" method=\"post\">";
  echo "<b>"._ID." ;; ;; ;; ;; ;</b>"
        ."<input type=\"text\" name=\"logid\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
   echo "<b>"._PILOT." ; </b><select name=\"pilot\">";
            $sql1 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result1 = $db->sql_query($sql1);
            while ($row = $db->sql_fetchrow($result1)) {
            $pilotid = $row[p_id];
            $pilot2 = $row[p_pilot];
            if ($pilotid == $pilot2) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot2</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._SELECTHOST." ; </b><select name=\"host\">";
            $sql2 = "SELECT p_id, p_pilot FROM ".$prefix."_pilots ORDER BY p_id";
        $result2 = $db->sql_query($sql2);
            while ($row = $db->sql_fetchrow($result2)) {
            $pilotid = $row[p_id];
            $pilot1 = $row[p_pilot];
            if ($pilotid == $pilot1) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$pilotid\">$pilot1</option>\n";
        $sel = "";
        }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._MISSION." ;</b> <select name=\"mission\">";
        $sql3 = "SELECT  ms_id, ms_mission  FROM ".$prefix."_flt_mission ORDER BY ms_id";
        $result3 = $db->sql_query($sql3);
            while ($row = $db->sql_fetchrow($result3)) {
            $msid = $row[ms_id];
            $mission1 = $row[ms_mission];
            if ($msid == $mission1) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$msid\">$mission1</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
         echo "<b>"._HRS." ;</b> <select name=\"hrs\">";
        $sql4 = "SELECT  hr_id, hr_time  FROM ".$prefix."_flt_hrs ORDER BY hr_id";
        $result4 = $db->sql_query($sql4);
            while ($row = $db->sql_fetchrow($result4)) {
            $hrid = $row[hr_id];
            $hrtime = $row[hr_time];
            if ($hrid == $hrtime) {
            $sel = "selected ";
        }
            echo "<option $sel value=\"$hrid\">$hrtime</option>\n";
        $sel = "";
    }
        echo "</select>"
        ."<br><br>";
        echo "<b>"._AA." ;</b>"
        ."<input type=\"text\" name=\"aakills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._AG." ;</b>"
        ."<input type=\"text\" name=\"agkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>"
        ."<b>"._SK." ;</b>"
        ."<input type=\"text\" name=\"shipkills\" size=\"10\" maxlength=\"80\"></font>"
        ."<br><br>";
        echo  "<b>"._LT." ;</b>"
        ."<input type=\"radio\" name=\"landtakeoff\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"landtakeoff\" value=\"0\">"._NO."<br><br>";
         "<br><br>";
      echo "<b>"._CT." ;</b>"
        ."<input type=\"radio\" name=\"carriertakeoff\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"carriertakeoff\" value=\"0\">"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._FL." ;</b>"
    ."<input type=\"radio\" name=\"fieldlanding\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"fieldlanding\" value=\"0\">"._NO."<br><br>";
           "<br><br>";
    echo "<b>"._CL." ;</b>"
    ."<input type=\"radio\" name=\"carrierlanding\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"carrierlanding\" value=\"0\">"._NO."<br><br>";
          "<br><br>";
    echo "<b>"._CD." ;</b>"
    ."<input type=\"radio\" name=\"crasheddead\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"crasheddead\" value=\"0\">"._NO."<br><br>";
         "<br><br>";
    echo  "<b>"._CW." ;</b>"
    ."<input type=\"radio\" name=\"crashedwalk\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"crashedwalk\" value=\"0\">"._NO."<br><br>";
           "<br><br>";
    echo  "<b>"._WON." ;</b>"
    ."<input type=\"radio\" name=\"won\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"won\" value=\"0\">"._NO."<br><br>";
            "<br><br>";
    echo  "<b>"._LOST." ;</b>"
    ."<input type=\"radio\" name=\"lost\" value=\"1\" checked>"._YES."  ;;
        <input type=\"radio\" name=\"lost\" value=\"0\">"._NO."<br><br>";
    echo "<center><input type=\"submit\" value=\""._SAVECHANGES."\"'></center>"
        ."</form>";
    if  ($submit) {


      $sql8 = "INSERT INTO".$prefix."_flt_log (flt_host,flt_lod_id,flt_mission,flt_pilot,flt_hrs,flt_aa_kills,flt_ag_kills,flt_car_to,flt_field_to,flt_traps,flt_field_landing,flt_crash_die,flt_crash_walk,flt_won,flt_lost,flt_skills) VALUES (NULL,'$pilot1','$logid','$mission1','$pilot2','$hrtime','$aakills','$agkills','$carriertakeoff','$landtakeoff','$carrierlanding','$fieldlanding','$crasheddead','$crashedwalk','$won','$lost','$shipkills')";
          $result8 = $db->sql_query($sql8);


}
    CloseTable();
    include("footer.php");


?>


SQL Table that goes with it

CREATE TABLE `nuke_flt_log` (
  `flt_id` tinyint(255) NOT NULL auto_increment,
  `flt_host` varchar(255) default NULL,
  `flt_log_id` varchar(255) default NULL,
  `flt_mission` varchar(50) default NULL,
  `flt_pilot` varchar(50) default NULL,
  `flt_hrs` varchar(25) default NULL,
  `flt_aa_kills` varchar(25) default '0',
  `flt_ag_kills` varchar(25) NOT NULL default '0',
  `flt_car_to` varchar(5) NOT NULL default '0',
  `flt_field_to` varchar(5) NOT NULL default '0',
  `flt_traps` varchar(5) NOT NULL default '0',
  `flt_field_landing` varchar(5) NOT NULL default '0',
  `flt_crash_die` varchar(5) NOT NULL default '0',
  `flt_crash_walk` varchar(5) NOT NULL default '0',
  `flt_won` varchar(5) NOT NULL default '0',
  `flt_lost` varchar(5) NOT NULL default '0',
  `flt_skills` varchar(255) NOT NULL default '0',
  PRIMARY KEY  (`flt_id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;




Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Your better off attaching it in a zip file.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum