On the line where you’re defining $id
:
<?php
$id= $result->id;
global $wpdb;
You’re getting the $id
field in $result
. $result
is an array of the objects returned from the database get_results
call. It looks like you want to use the $print
variable for the current row in the loop, so $id = $print->id
.