function updateRuidos($link, $valoracion, $fabricante, $db_query) { $stmt = "UPDATE ruidos SET valoracion={$valoracion}, is_alerta='1', fabricante={$fabricante} WHERE link={$link}"; executeNonQuery(Bnumber(), $db_query, $stmt); }
function insertAccount($userid, $accountNumber, $balance) { $connection = openDb(); $date = date('Y-m-d'); //Using prepared statements and parameterized queries: $sql = "INSERT INTO accounts(USER, ACCOUNT_NUMBER, BALANCE, DATE_CREATED) "; $sql .= "VALUES (?, ?, ?, ?)"; $stmt = $connection->stmt_init(); if (!$stmt->prepare($sql)) { return false; } $stmt->bind_param("ssis", $userid, $accountNumber, $balance, $date); return executeNonQuery($stmt, $connection); }