I am trying to convert an old mysql_ code into mysqli_ renaming all to mysqli_ doesn't work, I keep getting "Warning: mysqli_query() expects at least 2 parameters, 1 given in" and "Warning: mysqli_error() expects parameter 1 to be mysqli, string given in" could anyone help me on this on how can I convert the code below to work. I can't find an easy to understand tutorial.
function TicketFetcher(){
$ticketsSQl = "SELECT tickets FROM tickets";
$ticketsResult = mysqli_query($ticketsSQl) or die("Failed sql is " .
$ticketsSQl . "<br>Invalid query: " . mysqli_error());
$tickets = mysqli_fetch_array($ticketsResult);
$tickets = $tickets[0];
return $tickets;
}