On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • MODx EVO 1.0.12
    I am trying to insert posted form data into a custom table using the following function/statement which is part of a larger php processing script. The script runs without error, however the database table is not updated.
    I would be very grateful if someone could check this code and advise where my errors are.

    if (($name) && ($phone) && ($email) && ($id)) {
    	function add_student($name, $phone, $email, $id) {
            global $modx;
    	$session_id = intval($id, 10);
            $query = $modx->db->insert `rsacours_modx`.`xtra_students`(`name`, `phone`, `email`, `session_id`) VALUES ('$name', '$phone', '$email', '$session_id');  
            return $query;
    	}
    }