func SaveSiteInfo(info InfoMoodle, url string, username string) error {
	connection, err := db.GetDB()
	if err != nil {
		return err
	}

	statement, err := connection.Prepare(`
		INSERT INTO moodles(url, username, password, wstoken, location, sitename, firstname, lastname, lang, userid, userpictureurl)
		VALUES (?,?,?,?,?,?,?,?,?,?,?)`)
	if err != nil {
		return err
	}

	defer statement.Close()

	res, err := statement.Exec(url, username, info.Password, info.Token, info.Location, info.Sitename, info.Firstname, info.Lastname, info.Lang, info.Userid, info.Userpictureurl)
	if err != nil {
		return err
	} else if num, err := res.RowsAffected(); num == 0 || err != nil {
		err = errors.New("Info wasn't stored")
	}
	return err
}
// SaveSiteInfo saves the remaining Moodle info
SaveSiteInfo saves the remaining Moodle info
// SaveSiteInfo saves the remaining Moodle info
func SaveSiteInfo(info InfoMoodle, url string, username string) error {
	connection, err := db.GetDB()
	if err != nil {
		return err
	}
	statement, err := connection.Prepare(`
		INSERT INTO moodles(url, username, password, wstoken, location, sitename, firstname, lastname, lang, userid, userpictureurl)
		VALUES (?,?,?,?,?,?,?,?,?,?,?)`)
	if err != nil {
		return err
	}
	defer statement.Close()
	res, err := statement.Exec(url, username, info.Password, info.Token, info.Location, info.Sitename, info.Firstname, info.Lastname, info.Lang, info.Userid, info.Userpictureurl)
	if err != nil {
		return err
	} else if num, err := res.RowsAffected(); num == 0 || err != nil {
		err = errors.New("Info wasn't stored")
	}
	return err
}
func SaveSiteInfo ( info InfoMoodle , url string , username string ) error { connection , err := db . GetDB ( ) if err != nil { return err } statement , err := connection . Prepare ( `
		INSERT INTO moodles(url, username, password, wstoken, location, sitename, firstname, lastname, lang, userid, userpictureurl)
		VALUES (?,?,?,?,?,?,?,?,?,?,?)` ) if err != nil { return err } defer statement . Close ( ) res , err := statement . Exec ( url , username , info . Password , info . Token , info . Location , info . Sitename , info . Firstname , info . Lastname , info . Lang , info . Userid , info . Userpictureurl ) if err != nil { return err } else if num , err := res . RowsAffected ( ) ; num == 0 || err != nil { err = errors . New ( " " ) } return err }
SaveSiteInfo saves the remaining Moodle info
SaveSiteInfo saves the remaining Moodle info