Advertisement

08.12.2003 at 11:34AM PDT, ID: 20707538
[x]
Attachment Details

Why the following code doesn't insert data into the database?

Asked by MahmoodR in PHP Scripting Language

Tags: bxval, extract, file, insert

Does any body know what wrong is with following code? It doesn't insert data into the database. Any help would be appreciated.

<?php
global $btnClicked;
global $myConn;
global $myRS;
global $CollItem;
global $EmpUserName;
global $vRecordToDelete;
global $RecordCount;
global $LocalRecordCount;
global $vTimeIn;
global $EmpNote;
global $EmpTimeOffReason;
global $vTimeOutglobal;
global $EmpTimeStamp;
global $Index;

$LocalRecordCount = 0;            //Keeps track of the last record for current user.
$RecordCount= 0;
$Index = -1;            //Initialize the desplay's table index.
extract($_POST);      // Extracts data from the form in the previous page.
$btnClicked = $btnval;
if($btnClicked == "Time Out"){
echo "<HTML><HEAD><TITLE> Employee's History </TITLE>";


echo "<STYLE>.tblDiv {";
            echo "LEFT: 12%; POSITION: absolute; TOP: 10% }";
      echo "</STYLE>";
      echo "<STYLE>";
            echo "H2 {FONT-FAMILY: SANS-SERIF}";
            
      echo "</STYLE>";
echo "<SCRIPT LANGUGE = \"JAVASCRIPT\" SRC = \"HighLi~1.js\">";
echo "</SCRIPT>";

echo "</HEAD>";
echo "<BODY leftMargin=0 topMargin=0 BGCOLOR = \"#e0ffff\">";
     
         $UserName = $_COOKIE['user'];      //Getting the user name from the global file
         $FirstName = $_COOKIE['First'];
         $LastName = $_COOKIE['Last'];
         $EmpTimeStamp = $bxval;             //Reding the value of the checkbox.
         $EmpNote = $NoteText;
         $EmpTimeOffReason = $Reason;
         mysql_connect() or die("Problem connecting to the database");
            if ($EmpTimeStamp == "Time stamp" ){
                     $query= "insert into EmpOutTable values( '$FirstName', '$LastName', DATE, TIME, \"0000\", \"0000\", '$EmpNote', '$EmpTimeOffReason', '$UserName', \"No\")";
                  $answer3 = mysql_db_query("AppDataBase", $query);  // Updating the database.
            }
              else
            {
                  $query= "insert into EmpOutTable
                  values( '$FirstName', '$LastName', \"0000\", \"0000\", \"0000\", \"0000\", '$EmpNote', '$EmpTimeOffReason', '$UserName', \"No\")";
                  $answer3 = mysql_db_query("AppDataBase", $query);  // Updating the database.
         }
      
        mysql_free_result($answer3);
</body></html>       

Please note that this is a part of a longer program which has been cut for debugging reasons.Start Free Trial
[+][-]08.12.2003 at 03:47PM PDT, ID: 9134301

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 03:49PM PDT, ID: 9134308

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.14.2003 at 05:33AM PDT, ID: 9145982

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 07:33AM PDT, ID: 9146939

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 07:35AM PDT, ID: 9146967

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 08:44AM PDT, ID: 9147556

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 09:16AM PDT, ID: 9147868

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 11:43AM PDT, ID: 9149045

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2003 at 07:52PM PDT, ID: 9151809

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.16.2003 at 01:40PM PDT, ID: 9166558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2003 at 11:47AM PDT, ID: 9175578

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.18.2003 at 12:20PM PDT, ID: 9175869

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2003 at 06:36PM PDT, ID: 9177926

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: bxval, extract, file, insert
Sign Up Now!
Solution Provided By: iwarner
Participating Experts: 4
Solution Grade: B
 
 
[+][-]08.18.2003 at 06:48PM PDT, ID: 9177970

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2003 at 11:11AM PDT, ID: 9182849

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2003 at 11:35AM PDT, ID: 9183034

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2003 at 05:14PM PDT, ID: 9184816

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2003 at 08:28AM PDT, ID: 9196241

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.27.2003 at 08:38AM PDT, ID: 9233361

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32