sorry to bother you guys, but been trying everything i could to get some data from database, and all the time it show's me blank, so i'm getting blank flashes as well :)
So what i need to to is,
as you see on the pic, i have a column ownerId with repeated data, this is ok, i work's like that, now what i want extract from the database is to show the itemId and count where ownerId = ?.
So have my query as bellow.
<table id="zctb" class="display table table-striped table-bordered table-hover" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Item Name</th>
<th>Item ID</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT ownerId, itemId, count from user_item where ownerId = :editid";
$query = $dbh2 -> prepare($sql);
$query->bindParam(':editid',$editid,PDO::PARAM_INT);
$query->execute();
$result=$query->fetch(PDO::FETCH_ASSOC);
$cnt=1;
if($query->rowCount() > 0){
foreach($results as $result){
?>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($result->item_name);?></td>
<td><?php echo htmlentities($result->itemId);?></td>
<td><?php echo htmlentities($result->count);?></td>
</tr>
<?php
$cnt=$cnt+1;
}
}
?>
</tbody>
</table>
but this don't return anything not even not data found on the table.
any idea?