As the title says I get an error where my database rows show the illegal string offset error in my rows if I try to output them from my SQL. Would like some help in resolving this.
This is the table I am trying to output:
Table Name: for_lease
I have three php files that connect to each other. Also this is already connected to the phpmyadmin so ill only show snippets.
for_lease.php (outputs the table)
<?php
session_start();
require_once('for_lease.vc.php');
?>
<div class="row">
<div class="col-md-12 form-group">
<div class="col-md-12 bg-color-white shadow border-radius"><!-- List { -->
<div class="row bg-color-dark-gold border-top-radius">
<div class="col-md-12 color-white section-title-bar">
<span class="ion-ios-list-outline"></span> FOR LEASE
</div>
</div>
<div class="col-md-12 spacer">
<a href="for_lease_add.php" class="color-dark-gold">
<span class="ion-plus-round"></span> ADD FOR LEASE</a>
</div>
<div class="col-md-12 spacer">
</div>
<table class="table table-hover spacer">
<thead align="center">
<td></td>
<td>NAME</td>
<td>TYPE</td>
<td>PRICE</td>
<td>CONDITION</td>
<td>CREATED</td>
</thead>
<?php foreach($lstProperty as $rowProperty) { ?>
<tr align="center">
<td>
</td>
<td>
<?php
echo($rowProperty['lease_name']);
?>
</td>
<td>
<?php
echo($rowProperty['lease_type']);
?>
</td>
<td>
<?php
echo($rowProperty['lease_price']);
?>
</td>
<td>
<?php
echo($rowProperty['lease_condition']);
?>
</td>
<td>
<?php
echo( date("Y-m-d", strtotime($rowProperty['createddate']) ));
?>
</td>
</tr>
<?php } ?>
</table>
</div><!-- List { -->
</div>
</div> <!--row-->
for_lease.vc.php (accessing the database and the class with the SQL)
<?php
require_once($routePath . "_config/db.php");
$dbConfig = new config_db();
$db = $dbConfig->init();
require_once($routePath . "_mc/Property.mc.php");
$mcProperty = new Property_MC();
$lstProperty = $mcProperty->SelectObj_ByLeaseId($db);
?>
Property.mc.php (contains the class with select SQL)
<?php
Class Property_MC {
public function SelectObj_ByLeaseId($db) {
$stmt = $db->prepare(
" SELECT leaseid, lease_type, lease_name, lease_address, lease_price, lease_condition, lease_description, recstatus, createddate
FROM for_lease"
);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
return $row;
}
}
?>
I checked that maybe somehow the output is read as a array, not a string hence the error, but I am not sure where in my code it is affected, or maybe theres something missing for the output to be read as a string.
Will appreciate any help, thank you.

