I have corrected most of it but then have come across the few lines below, which I’m getting errors for.
$mResult = mysqli_query($con,$mQry) or ("Wrong Select Query");
$mRecordCount = mysqli_num_rows($mResult);
I think I have the first one corrected but cant work out the second line, the first one being
$mResult = $pdo->prepare($mQry) or ("Wrong Select Query");
$mResult->execute();
But not 100%, and these are the errors
Notice: Undefined variable: con in \\CSFFILES11\WEBSITES\dev\category-Result.php on line 701
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in \\CSFFILES11\WEBSITES\dev\category-Result.php on line 701
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in \\CSFFILES11\WEBSITES\dev\category-Result.php on line 703
For counting rows you can use $mResult->rowCount() if you want to count rows, fetchColumn is use if you want to fetch specified column from table. http://php.net/manual/en/pdostatement.fetch.php
No. the expression after or does nothing and $mQry looks like it contains data that belong into parameters. fetchColumn() only retrieves a single value (not sure if you want that here).
I notice you are not putting any data in your execute. If it’s a fixed statement with no variables, there is no need to prepare and execute.
Or are you binding some parameters elsewhere, that we can’t see?
Do use prepare if the query contains variable data, particularly user input (and of course bind parameters for that data) or if you want to re-use the query multiple times.
Otherwise, there is no need.