Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
PHP
  1  bind_param('s',$email);
  2  		$query->execute();
  3  		//Store the result so we can check if the account exists in the database.
  4  		$->store_result();
  5  		if ($query->num_rows > 0) {
  6  			$error .= 'The email address is already registered!';
  7  		}else{
  8  			// Validate password
  9  			if (strlen($password) prepare("INSERT INTO users (name,email,password)VALUES (?,?,?);");
 10  				$insertQuery->bind_param("sss", $fullname, $email, $password_hash);
 11  				$result = $insertQuery->execute();
 12  				if ($result) {
 13  					$error .= 'Your registration was successful!';
 14  				} else {
 15  					$error .= 'Something went wrong!';
 16  				}
 17  			}
 18  		}
 19  
 20  	}
 21  	$query->close();
 22  	$insertQuery->close();
 23  	// Close DB connection
 24  	mysqli_close($db);
 25  }

>?

What I have tried:

Parse error: Unmatched ')' in C:\xampp\htdocs\Magosi carrental\register.php on line 3
Posted
Updated 19-Jul-22 14:44pm
v2

I really suggest you to try to learn the language. I never programmed in PHP but in c++, c#, js.

Looks like this should solve the issue....

PHP
bind_param('s',$email);
$query->execute();
//Store the result so we can check if the account exists in the database.
$->store_result();
if ($query->num_rows > 0) {
	$error .= 'The email address is already registered!';
}else{
	// Validate password
	if (strlen($password) > 0){
		$insertQuery->prepare("INSERT INTO users (name,email,password)VALUES (?,?,?);");
		$insertQuery->bind_param($fullname, $email, $password_hash);
		$result = $insertQuery->execute();
		if ($result) {
			$error .= 'Your registration was successful!';
		} else {
			$error .= 'Something went wrong!';
		}
		$insertQuery->close();
	}
}
$query->close();
// Close DB connection
mysqli_close($db);
 
Share this answer
 
v6
Comments
0x01AA 16-Jul-22 13:20pm    
Holy s..., forgive me my frequent updates. Take care while try that solution.
What's this line do?
$->store_result();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900