Forum Moderators: coopster
here is my code
<?php
require("config.php");
$Employee_ID = $_POST["Employee_ID"];
if($_GET['action'] == 'post')
{
if(empty($_POST['Employee_ID']) ¦¦ empty($_POST['Date']) ¦¦ empty($_POST['Activity']) ¦¦ empty($_POST['Miles']))
{
error("blank"); //Prints out error message if fields are blank
exit;
}
if(!empty($_POST['Employee_ID']))
{
$query="SELECT Employee_ID FROM analyzer_query WHERE Employee_ID = $Employee_ID";
$rs = $conn->execute($query);
$num_columns = $rs->Fields->Count();
}
if($rs <= 0)
{
echo error ("user"); //Prints out error message if invalid user
exit;
}
else
{
$conn->execute("INSERT INTO Activity_Log (`Employee_ID`, `Date`, `Activity`, `Miles`) VALUES ('{$_POST['Employee_ID']}', '{$_POST['Date']}', '{$_POST['Activity']}', '{$_POST['Miles']}')");
// header("Location: success.php?action=success");
}
}
function error($error)
{
if($error == 'blank')
{ //blank error
echo "Please fill in all the required fields before submitting";
} //user error
if($error == 'user')
{
echo "Please fill in the correct Employee ID";
}
}
?>
Can someone please help me? I'm at a loss with this and i need it done ASAP! Any help would be greatly appreciated!
Well here are the errors i'm getting
Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft OLE DB Provider for ODBC Drivers Description: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. in F:\InetPub\wwwroot\EmployeeWellnessProgram\WellnessSubmit.php on line 15Fatal error: Call to a member function on a non-object in F:\InetPub\wwwroot\EmployeeWellnessProgram\WellnessSubmit.php on line 16
here is my config.php file also
<?php $conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
$connStr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=F:\Wellness Program\Copy of HR Employee Wellness Program.mdb;";
$conn->open($connStr); //Open the connection to the database
?>
my guess would be that is a function somewhere in your code
try searching for that function in your files and take a look at it. It seems to be saying that it didn't get the appropriate number of parameters when called.
my other guess is that something in between is failing silently and causing nothing to be sent to the Invoke function