Hello,
Im trying to make a code that will chech the db if the user already exists and if the user does not exist then the script should add the user to the db.
here is the code:
$result = mysql_query("SELECT * FROM users WHERE username = $regUser", $db); // I ussually get an error here 🙁
$col = mysql_fetch_array($result);
if ($col['username'] != $regUser) {
$sql = "INSERT INTO users (username, user_password, user_name, user_lastname)
VALUES ('$regUser', '$regPass', '$regName', '$regLastName')";
$result = mysql_query($sql);
My code is not working... can you pls help!