0

I would like to print my usernames Into a list on my page. I've wrote my query correct im sure of that but i get this error:

Fatal error: Cannot redeclare get_users() (previously declared in C:\wamp1\www\cms1\user_list.php:70) in C:\wamp1\www\cms1\includes\user_list_functions.php on line 7

Here is the part of the user_list.php:70

function get_users($username){
    echo $username;
}

here is my function : User_list_functions.php:7

function get_users($username) { 
    global $connection;
    $query = "SELECT * FROM users_survey WHERE username = {$username} ORDER BY position ASC";
    $username = mysql_query($query, $connection);
    confirm_query($username);
}
George Brighton
  • 5,131
  • 9
  • 27
  • 36
Armando
  • 7
  • 3

2 Answers2

3

Your error is clear, you have two get_users functions

Fabien Papet
  • 2,244
  • 2
  • 25
  • 52
0

I think you have included user_list.php in User_list_functions.php and that's why both functions are conflicting...

Sol: either remove the included user_list.php or use classes (object oriented programming) for a better understanding or result...

Peter David Carter
  • 2,548
  • 8
  • 25
  • 44