Copyright (C) 2013 Daniel Johansson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
$relationinfo = $db->query("SELECT user2 from dateInterests WHERE(user1='$username')");
$relationstring = $relationinfo->fetchAll();
echo '';
foreach ($relationstring as $relationquery) {
$userinfo = $db->query("SELECT firstName from Users WHERE loginName='$relationquery[0]'");
$self = $userinfo->fetchAll();
$firstName = $self [0]['firstName'];
$userinfo = $db->query("SELECT surName from Users WHERE loginName='$relationquery[0]'");
$self = $userinfo->fetchAll();
$surName = $self [0]['surName'];
echo '- ' . $firstName . ' ' . $surName . '
';
}
echo '
';
echo '';
echo '';
$relationinfo = $db->query("SELECT user2 from dateInterests WHERE(user1='$username')");
$relationstring = $relationinfo->fetchAll();
foreach ($relationstring as $relationquery) {
$relation2info = $db->query("SELECT user2 from dateInterests WHERE(user1='$relationquery[0]')");
$relation2string = $relation2info->fetchAll();
foreach ($relation2string as $relation2query) {;
if($relation2query[0] == $username){
$userinfo = $db->query("SELECT firstName from Users WHERE loginName='$relationquery[0]'");
$self = $userinfo->fetchAll();
$firstName = $self [0]['firstName'];
$userinfo = $db->query("SELECT surName from Users WHERE loginName='$relationquery[0]'");
$self = $userinfo->fetchAll();
$surName = $self [0]['surName'];
echo '- ' . $firstName . ' ' . $surName . '
';
}
}
}
echo '
';
?>