function getTwitter($id) { try { $stmt = getTwitterAccounts($id); $urls = array(); while ($result = $stmt->fetch(PDO::FETCH_OBJ)) { $urls[] = $result->Account; } return $urls; } catch (PDOException $e) { header('Location: ../vues/vue_profile.php?error=db'); exit; } }
function getTwitter($id) { try { $stmt = getTwitterAccounts(id); $account = array(); while ($result = $stmt->fetch(PDO::FETCH_OBJ)) { $account[] = $result->Account; } if (0 >= count($account)) { header('Location: ../vues/vue_display_profile.php?error=invalidid'); } return $account; } catch (PDOException $e) { header('Location: ../vues/vue_display_profile.php?error=db'); exit; } }