Jump to content

PHP with MYSQL Queries help


aerolite

Recommended Posts

// 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?

Link to comment
https://forums.phpfreaks.com/topic/261696-php-with-mysql-queries-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.