It doesn't insert row in the table.
/*add to group*/
if($edu_school=="I.T"){
$group_id = $_POST["3"];
$db->query(sprintf("INSERT INTO groups_members (group_id, user_id) VALUES (%s,%s)" )) or _error(SQL_ERROR_THROWEN);
}
Where is you set value?!
Try like this
if($edu_school=="I.T"){
$group_id = (string)$_POST["3"];
$query=sprintf("INSERT INTO groups_members (group_id, user_id) VALUES (%s,%s)",$group_id,"1" );
$db->query($query) or _error(SQL_ERROR_THROWEN);
}
The values for both string placeholders are missing. See sprintf for documentation.
Side note: Please be aware that with this method your code will still be vulnerable to SQL Injections.