title: Cannot redeclare user_data() error
body: <p>i am creating a user accounts system for my website however when i use the  <code>include 'core/init.php';</code> function i get the error. This could be something really simple as I am a beginner and just learning.    </p>
  
  <pre><code>Fatal error: Cannot redeclare user_data() (previously declared in C:\xampp\htdocs\PatchMyPC\core\functions\users.php:3) in C:\xampp\htdocs\PatchMyPC\core\functions\users.php on line 17
  </code></pre>
  
  <p>here is the code for my users.php &amp; init.php files</p>
  
  <p>init.php</p>
  
  <pre><code>&lt;?php
  session_start();
  //error_reporting(0);
  
  require 'database/connect.php';
  require 'functions/users.php';
  require 'functions/general.php';
  
  if (logged_in() === true) {
      $session_user_id = $_SESSION['user_id'];
      $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'first_name', 'last_name', 'email');
      if (user_active($user_data['username']) === false) {
          session_destroy();
          header('Location: index.php');
          exit();
      }
  }
  
  $errors = array();
  
  ?&gt;
  </code></pre>
  
  <p>users.php</p>
  
  <pre><code>&lt;?php
  
  function user_data($user_id) {
  $data = array();
  $user_id = (int)$user_id;
  
  $func_num_args = func_num_args();
  $func_get_args = func_get_args();
  
  if ($func_num_args &gt; 1) {
      unset($func_get_args[0]);
  
      $fields = '`' . implode('`, `', $func_get_args) . '`';
      $data = mysql_fetch_assoc(mysql_query("SELECT $fields FROM `users` WHERE `user_id` = $user_id"));
      return $data;
  }
  }
  
  function logged_in() {
      return (isset($_SESSION['user_id'])) ? true : false;
  }
  
  function user_exists($username) {
      $username = sanitize($username);
      return (mysql_result($query = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username'"), 0) == 1) ? true : false;
  }
  
  function user_active($username) {
      $username = sanitize($username);
      return (mysql_result($query = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `active` = 1"), 0) == 1) ? true : false;
  }
  
  function user_id_from_username($username) {
      $username = sanitize($username);
      return mysql_result(mysql_query("SELECT `user_id` FROM `users` WHERE `username` = '$username'"), 0, 'user_id');
  }
  
  function login($username, $password) {
      $user_id = user_id_from_username($username);
  
      $username = sanitize($username);
      $password = md5($password);
  
      return (mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `password` = '$password'"), 0) ==1) ? $user_id : false;
  }
  ?&gt;
  </code></pre>