how to fetch single row with all columns in custom php function and return result
here is my custom function code
function getdata($sql,$dbh) {
You are not executing your Query?!
$dbh = new PDO("connection string"); $get_row = $dbh->prepare($sql); $get_row->execute(); $row = $get_row->fetch();
Try this for get Single Row of all column.