Waterfall is probably right. Revise your code as follows:
$result = mysqli_query($dbc,$sql1) or die(mysqli_error($dbc));
// and
$result = mysqli_query($dbc,$sql2) or die(mysqli_error($dbc));
PS: Just wondering what exactly is $page
? Did you forget to do a:
global $page;