We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • 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;
    	}
    }