I have an issue when executing the sql query.I am explaining my code below.
complain.php:
require_once("./include/dbconfig.php");
if($_REQUEST['typeOfApp']=="WEB"){
        $sent_form="Web";
        $ticket_id=generateTicketId('W1');
    }
function generateTicketId($code){
        $sql="select * from db_ticket order by id desc ";
        $qrylast=mysqli_query($con,$sql);
        echo mysqli_num_rows($qrylast);exit;
}
Here i am trying to check the number of rows.But I am not getting anything.I am giving my dbconfig.php below.
dbconfig.php
$con = new mysqli("localhost", "root", "****", "************"); 
if ($con->connect_error)die("Connection failed: "); 
Here i need to check the no of rows present inside the table.Please help me.
