Novice SQL & PHP user here, still learning.
Currently trying to complete a project for a friend, however, come across this error when trying to sum a column in SQL via php - Resource id #13.
PHP:
$uid = $user->data['id'];
//FETCH NUMBER OF SLOTS
$totalBookedSlots = $db->query( "SELECT COUNT(dj) FROM timetable WHERE dj='{$uid}' LIMIT 1" );
//TOTAL SLOTS ARRAY
$totalBookedSlots1 = mysql_result($totalBookedSlots,"totalBookedSlots");
...
<div class="box" style="width: 200px;">
<div class="square title"><strong>Slots Booked</strong></div>
<p>You have <strong><?php echo $totalBookedSlots; ?></strong> slots booked!</div>
<?php } ?>
</div>
A