I've got PEAR working correctly on my system. I'm trying to run an
update query. Here's what I've got:
// get variables from editjoblisting.php
$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'];
$table_fields = array('requisition_no', 'vacancies');
$table_values = array($req_no,$vacancies);
$table_name = 'joblisting';
$sth = $db->autoPrepare($table_name, $table_fields, DB_AUTOQUERY_UPDATE,
'joblisting_id = '.$id);
$result = $db->execute($sth, $table_values);
// Check the result object in case there was an error, and handle it
here.
if (DB::isError($result))
{
die($result->getMessage() . " " . $result->getDebugInfo());
}
?>
Here's the error message:
DB Error: no such field UPDATE joblisting SET requisition_no =
'03-349',vacancies = '1' WHERE joblisting_id = 1
Now if I change my statement handler to this:
$sth = $db->autoPrepare($table_name, $table_fields, DB_AUTOQUERY_UPDATE,
'joblisting_id = 1');
It works correctly. So how can I make the statement handler use my
variable $id since its gathering this from the form?
--
Jeff Self
Information Technology Analyst
City of Newport News
Personnel Department
2400 Washington Drive
Newport News, VA 23607
757-926-3741
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|