Location: PHPKode > scripts > user_registration_module > user_registration_module/class_register.php
<?php

class Register {


	public function AddUser($username, $password, $firstname, $lastname, $street_address, $zipcode,$country,
	$city, $age, $gender, $phone, $email) {
		
		//
		
		$sql =  "SELECT username FROM users where username ='$username'";
		$result = mysql_query($sql);
		

		if (mysql_num_rows($result) > 0) {
			
			echo ("User is already exist");
			
			}  
	
			else {
	
	//
	
		$sql = "INSERT INTO users (username, password, first_name, last_name, street_address, zipcode, country,
		city, age, gender, phone, email) VALUES
		('".$username."', '". sha1($password)."', '".$firstname."', '".$lastname."', '".$street_address."',
		'".$zipcode."', '".$country."', '".$city."', '".$age."', '".$gender."', '".$phone."', '".$email."')";
		
		mysql_query($sql) or die(mysql_error());
		
			}
	}

}

?>
Return current item: user_registration_module