How do I turn the following 2 queries into 1 query
$sql = \"SELECT level FROM skills WHERE id = $id LIMIT 1;\"; $result = $db->sql_query($sql); $level = (
With PDO and prepared query:
$query = $db->prepare("UPDATE skills SET level = level + 1 WHERE id = :id") $query->bindValue(":id", $id); $result = $query->execute();