susannanam
Member
hi all,
i have a list with a php plugin. the various field-values ($id_user and $student) i pull are correct and so is the sql statement as it correctly inserts if tested the output of the var_dump directly in mysql. i have also deactivated the delete statement before... but nothing helps. if i run the php, it gives me the error "k is null". when activating debug = js, then it says "json is null". and it keeps telling me the following:"SyntaxError: missing ) in parenthetical"
Here is the code of my plugin:
does anyone have an idea what can the problem be????????
thanks
susanne
i have a list with a php plugin. the various field-values ($id_user and $student) i pull are correct and so is the sql statement as it correctly inserts if tested the output of the var_dump directly in mysql. i have also deactivated the delete statement before... but nothing helps. if i run the php, it gives me the error "k is null". when activating debug = js, then it says "json is null". and it keeps telling me the following:"SyntaxError: missing ) in parenthetical"
Here is the code of my plugin:
Code:
$app = JFactory::getApplication();
$ids = $app->input->get('ids', array(), 'array');
$user = JFactory::getUser();
$id_user = $user->get('id');
//$item = $model->getTable();
//echo "<pre>";print_r($item);exit;
//empty statement table from previous statements by that user
$sql = "delete FROM sh2m8_student_statement
WHERE user_id = $id_user;";
//var_dump($sql); exit;
$db->setQuery( $sql );
$db->execute();
foreach ($ids AS $myid)
{
$row = $model->getRow($myid);
$student = $row->sh2m8_student___student_id;
//$element_raw = $row->your-full-elementname_raw;
//var_dump($student); exit;
$sql = "insert into sh2m8_student_statement
(tx_date,term_id,type,student_id,debit,
credit,description,reference,update_by,update_timestamp,
audit_no,ccm,user_id)
select tx_date,term_id,type,student_id,debit,
credit,description,reference,update_by,update_timestamp,
audit_no,ccm,$id_user
FROM sh2m8_student_accounts WHERE student_id = '$student';";
//var_dump($sql); exit;
$db->setQuery( $sql );
$db->execute();
//echo "<pre>";print_r($row);
}
//exit;
does anyone have an idea what can the problem be????????
thanks
susanne