ExecuteRow()

Hi everbodyIam using PHPMaker 2020I need to show all names from the table names
I ahve used the following code:<?php $sql = ExecuteRow("SELECT Name FROM names"); while($row = $sql->fetch_assoc()) { echo $row['Name']; } ?>but I recieved the following error:
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean …Could somebody hlp please?
Thanks

ExecuteRow() returns the array already, no need to fetch.

Thank youit gives me the first row only<?php $row = ExecuteRow("SELECT Name FROM names"); echo $row['Name']; ?>How could I show all rows ?Thanks

HI.
Hope the below helps:<?php $rows = ExecuteRows("SELECT Name FROM names") if(count($email_rows) > 0){ foreach($rows as $drow){ echo $drow["description"] }else{ echo "No Names found"; } ?>

Hi everybody

Could you help?

How could I update this code for PhPMaker2021 ?

<?php $rows = ExecuteRows("SELECT Name FROM names"); if(count($rows) > 0){ foreach($rows as $drow){ echo $drow["Name"] . "
"; } } ?>

Thank you
M.

hammadmohd wrote:

echo $drow[“Name”] . “
”;

No change required. You may debug by, e.g.

var_dump($rows);