invalid number error in update query
| From: | Jeff Self | Date: | Wed, 28 May 2003 15:49:41 +0000 |
| Subject: | invalid number error in update query | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5659@lists.php.net to get a copy of this message | ||
I've got an update form that passes the values to another page for
updating. Here's the code:
require_once ("DB.php");
session_start();
page_header('Edit Job Listing Results');
// open connection to the database
$db = DB::connect($dsn, FALSE);
// Check whether the object is a connection or an error.
// Print out a message and exit if it's an error object.
if (DB::isError($db))
{
die($db->getMessage());
}
// get variables from editjoblisting.php
$joblisting_id = $_REQUEST['joblisting_id'];
$req_no = $_REQUEST['requisition_no'];
$jobdescription_id = $_REQUEST['jobdescription_id'];
$description = $_REQUEST['description'];
$vacancies = $_REQUEST['vacancies'];
$internal_only = $_REQUEST['internal_only'];
$active = $_REQUEST['active'];
$submitted_by = $_REQUEST['submitted_by'];
// Query for editing Job Listing
$query = "UPDATE joblisting SET vacancies='$vacancies' WHERE
joblisting_id = '$joblisting_id'";
$result = $db->query($query);
// Check the result object in case there was an error, and handle it
here.
if (DB::isError($result))
{
echo "Query Error.";
die($result->getMessage());
}
?>
When I hit submit on the form, I get the following error message on this
page:
Query Error.DB Error: invalid number
What is this invalid number mean?
I displayed the passed variables and they all are correct with the
changes showing. But the database doesn't get updated.
--
Jeff Self
Information Technology Analyst
City of Newport News
Personnel Department
2400 Washington Drive
Newport News, VA 23607
757-926-3741