<commit_before><?php
require 'dbconfig.php';
$email = $_POST['email'];
$password = $_POST['<PASSWORD>'];
$name = $_POST['name'];
$pwd = password_hash($password, PASSWORD_BCRYPT);
$jsondata = array();

$searchUser = "SELECT * FROM $tbl_name WHERE email = '$email' ";
$result = $connection->query($searchUser);
$count = mysqli_num_rows($result);

if ($count == 1) {
    $jsondata['message'] = 'Sesión iniciada';
    $jsondata['id']      = $row['id'];
    $jsondata['email']   = $row['email'];
} else {
    $query = "INSERT INTO $tbl_name (email, password, name) VALUES ('$email', '$pwd', '$name')";
    if ($connection->query($query) === TRUE) {
        $jsondata['id']      = $row['id'];
        $jsondata['email']   = $row['email'];
        $jsondata['message'] = 'Sesión iniciada, bienvenido';
    } else {
        $jsondata['message'] = "Error al crear el usuario." . $query . "<br>" . $connection->error;
    }
}
echo json_encode($jsondata);
mysqli_close($connection);<commit_msg>Se corrige la llamada a la variable row haciendo una peticion a la casew<commit_after><?php
require 'dbconfig.php';

$email = $_POST['email'];
$password = $_POST['<PASSWORD>'];
$name = $_POST['name'];
$pwd = password_<PASSWORD>($password, <PASSWORD>);
$jsondata = array();

$searchUser = "SELECT * FROM $tbl_name WHERE email = '$email' ";
$result = $connection->query($searchUser);
$count = mysqli_num_rows($result);

if ($count == 1) {

    $sql = "SELECT * FROM $tbl_name WHERE email = '$email'";
    $result = $connection->query($sql);
    $row = $result->fetch_array(MYSQLI_ASSOC);

    $jsondata['message'] = 'Sesión iniciada';
    $jsondata['id']      = $row['id'];
    $jsondata['email']   = $row['email'];
} else {
    $query = "INSERT INTO $tbl_name (email, password, name) VALUES ('$email', '$pwd', '$name')";
    if ($connection->query($query) === TRUE) {
        $sql = "SELECT * FROM $tbl_name WHERE email = '$email'";
        $result = $connection->query($sql);
        $row = $result->fetch_array(MYSQLI_ASSOC);

        $jsondata['id']      = $row['id'];
        $jsondata['email']   = $row['email'];
        $jsondata['message'] = 'Sesión iniciada, bienvenido';
    } else {
        $jsondata['message'] = "Error al crear el usuario." . $query . "<br>" . $connection->error;
    }
}
echo json_encode($jsondata);
mysqli_close($connection);
{'fraction_non_alphanumeric': 0.21043627031650983, 'fraction_numerical': 0.000855431993156544, 'mean_word_length': 4.062770562770563, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4766838', 'n_tokens_mistral': 808, 'n_tokens_neox': 817, 'n_words': 176}