0

This piece of code is causing error i am doing this project on my PC not on sololearn

here is the code $checkusername = "SELECT username FROM users_list WHERE username = '$userName'" $result = mysqli_query($conn,$checkusername) //check whether the user name already exists or not if (mysqli_num_rows($result) == 0) { $sql = "INSERT INTO users_list (fullname,username,birthdate,gender,password,session,dp,actype) VALUES('$fullName','$userName','$birth','$gender','$pass','$session','$dp','$actype')"; mysqli_query($conn,$sql); echo "<h1> Welcome '$fullName' </h1>"; mysqli_close($conn); } else { echo ("<script>alert('Username already taken'); window.location.href = '/'; </script>") } Error message = Parse error: syntax error, unexpected variable "$result" in C:\xampp\htdocs\multiplayerxo\profile.php on line 39

7th Jul 2023, 1:02 PM
Samuel
Samuel - avatar
1 Respuesta
+ 4
How do you see your data base? Is that above mentioned code complete?
7th Jul 2023, 4:17 PM
JaScript
JaScript - avatar