Her hele min kode :
Undtagen nogen få minsuser men de har ingen ting med det der at gøre.
- function new_user($username, $password, $email, $name, $last, $gender, $avatar) {
- global $mysqli;
- $ip = $_SERVER['REMOTE_ADDR'];
- $group = "1";
- if($stmt=$mysqli->prepare('INSERT INTO `users`(`username`, `password`, `email`, `name`, `last`,`who`, `ip`, `group`,`avatar`) VALUES (?,?,?,?,?,?,?,?,?)')) {
- $stmt->bind_param('sssssssis', $username, $password, $email, $name, $last, $gender, $ip,$group, $avatar);
- $stmt->execute();
- $stmt->close();
- echo 'Your user is now created';
- } else {
- echo 'There was an error with inserting your new user to the database. Try again and if that not work pleese contant us on : zinxan@gmail.com';
- }
- }
-
- function user_info_valid($username, $password) {
- global $mysqli;
- if ($stmt = $mysqli->prepare("SELECT COUNT(*) FROM `users` WHERE username=? AND password=?")) {
- $stmt->bind_param("ss", $username, $password);
- $stmt->execute();
- $stmt->bind_result($count);
- $stmt->fetch();
- $stmt->close();
- }
-
- return ($count > 0 ? true : false);
- }
-
- function email_ok($email) {
- global $mysqli;
- if ($stmt = $mysqli->prepare("SELECT COUNT(*) FROM `users` WHERE email=?")) {
- $stmt->bind_param("s", $email);
- $stmt->execute();
- $stmt->bind_result($count);
- $stmt->fetch();
- $stmt->close();
- }
-
- return ($count > 0 ? true : false);
- }
-
- function user_valid($username) {
- global $mysqli;
- if ($stmt = $mysqli->prepare("SELECT COUNT(*) FROM `users` WHERE username=?")) {
- $stmt->bind_param("s", $username);
- $stmt->execute();
- $stmt->bind_result($count);
- $stmt->fetch();
- $stmt->close();
- }
-
- return ($count > 0 ? true : false);
- }
-
- function get_data($SELECT, $username) {
- global $mysqli;
- if ($stmt = $mysqli->prepare('SELECT `{$SELECT}` FROM `users` WHERE `username`=?')) {
- $stmt->bind_param("s", $username);
- $stmt->execute();
- $stmt->bind_result($SELECT);
- while($stmt->fetch()) {
- echo $navne_id.'<br />';
- }
- $stmt->close();
- }
- }
- $SELECT = "name";
- echo get_data($SELECT, 'ZinXan');