<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$success = true;
if (is_null($value)) {
$value = array();
- $res = XDB::iterRow("SELECT m.country, gc.countryFR
+ $res = XDB::iterRow("SELECT m.country, gc.country
FROM profile_mentor_country AS m
INNER JOIN geoloc_countries AS gc ON (m.country = gc.iso_3166_1_a2)
WHERE m.pid = {?}",
$this->pid());
$this->values['expertise'] = null;
} else {
- XDB::execute("REPLACE INTO profile_mentor (pid, expertise)
- VALUES ({?}, {?})",
+ XDB::execute('INSERT INTO profile_mentor (pid, expertise)
+ VALUES ({?}, {?})
+ ON DUPLICATE KEY UPDATE expertise = VALUES(expertise)',
$this->pid(), $expertise);
$this->values['expertise'] = $expertise;
}
public function _prepare(PlPage &$page, $id)
{
- $page->assign('countryList', XDB::iterator("SELECT iso_3166_1_a2, countryFR
+ $page->assign('countryList', XDB::iterator("SELECT iso_3166_1_a2, country
FROM geoloc_countries
- ORDER BY countryFR"));
+ ORDER BY country"));
$page->assign('hrpid', $this->profile->hrpid);
}
}