// Check for this userID if exsist in cp_credits
$sql = "SELECT * FROM `cp_credits` WHERE account_id = $userid";
// Execute Query
$r = mysqli_query($dbc, $sql);
// If there are result in $r
if($r){
// Print a message indicating success or not:
while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){
$user_balance = $row['balance'];
$user_last_donation_date = $row['last_donation_date'];
}
}
else{
$user_balance = "nothing";
$user_last_donation_date = "nothing";
}
but either of my else statement does not work. Whats wrong with this?