03-29-2017, 12:47 PM
Hi
So heres the code I am using... but it doesnt seem to update the db... I cant seem to figure out where I am going wrong:
require_once $abs_us_root.$us_url_root.'users/classes/DB.php';'
$db = DB::getInstance();
$updatestatus = Input::Get('update');
$qid = Input::Get('id');
if ($updatestatus != 1) {
$fields = array(
'author' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
'webkey' => Token::generate(),
);
$db->insert('letters',$fields);
Redirect::to('lettersearch.php?msg=Letter+Saved!');
}
else {
$fields = array(
'lastupdatedby' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
);
$db->update('letters',$qid,$fields);
dump ($fields);
Redirect::to('lettersearch.php?msg=Letter+Updated!');
}
Any ideas what I am not seeing? There are no errors. If I goto the database, any changes made in any of the fields above do not get updated...
So heres the code I am using... but it doesnt seem to update the db... I cant seem to figure out where I am going wrong:
require_once $abs_us_root.$us_url_root.'users/classes/DB.php';'
$db = DB::getInstance();
$updatestatus = Input::Get('update');
$qid = Input::Get('id');
if ($updatestatus != 1) {
$fields = array(
'author' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
'webkey' => Token::generate(),
);
$db->insert('letters',$fields);
Redirect::to('lettersearch.php?msg=Letter+Saved!');
}
else {
$fields = array(
'lastupdatedby' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
);
$db->update('letters',$qid,$fields);
dump ($fields);
Redirect::to('lettersearch.php?msg=Letter+Updated!');
}
Any ideas what I am not seeing? There are no errors. If I goto the database, any changes made in any of the fields above do not get updated...