I think your issue may be the way you are mixing the single and double quotes.
Try the exact syntax as shown below this might solve the problem
CREATE USER 'sec_user'@'localhost' IDENTIFIED BY 'eKcGZr59zAa2BEWU'; GRANT SELECT, INSERT, UPDATE ON secure_login.* TO 'sec_user'@'localhost';
Above should work to create a user but as you're objective is actually to create a registration for users below is an implementation from one of my own projects. You firstly will need to create a customer table in youe database and then something like below....
<?php
$con = mysqli_connect("<yourHOST>","<yourUSER>",",<yourPASSWORD">,"<yourDBname>");
if (mysqli_connect_errno()) {
echo"
Failed to connect to the MySQL DB:".mysqli_connect_error();
}
/getting the ip address of the customer
function getIp() {
$ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $ip;
if (isset($_POST['cust_acc'])) {
global $con;
$ip = getIP();
$cust_name = $_POST['cust_name'];
$cust_email = $_POST['cust_email'];
$cust_pass = $_POST['cust_pass'];
$cust_image = $_FILES['cust_img']['name'];
$cust_image_tmp = $_FILES['cust_img']['tmp_name'];
$cust_ctry = $_POST['cust_ctry'];
$cust_city = $_POST['cust_city'];
$cust_contact = $_POST['cust_cont'];
$cust_addr = $_POST['cust_addr'];
$check_email = "SELECT * FROM customers WHERE customer_email='$cust_email'";
$run_check_email = mysqli_query($con, $check_email);
$check_rows = mysqli_fetch_array($run_check_email);
$checked_email = $check_rows['customer_email'];
if ($checked_email==$cust_email){
echo "
<script>alert('User Already Exists with submitted Email')</script>";
echo "<script>window.open('checkout.php','_self')</script>
";
}
else{
move_uploaded_file($cust_image_tmp,"customer/customer_images/$cust_image");
$insert_cust = "INSERT INTO customers(customer_ip,customer_name,customer_email,customer_pass,customer_country,customer_city,customer_contact,customer_image,customer_address)
VALUES('$ip','$cust_name','$cust_email','$cust_pass','$cust_ctry','$cust_city','$cust_contact','$cust_image','$cust_addr')";
$run_insert = mysqli_query($con, $insert_cust);