Ciao a tutti,
ho una query che SE username && pw sono sbagliati, restituisce cmq questo risultato:

codice:
idCustomer	nameShop	totalMembersCard
NULL	           NULL	           0
Ora, in PHP, io salvo il risultato in un array:

codice:
if($result->num_rows > 0) {
while($row = mysqli_fetch_array($result)) {
$customer =	array(	'idCustomer'=>$row['idCustomer'],
					'nameShop'=>$row['nameShop'],
					'totalMembersCard'=>$row['totalMembersCard']);
} // while 
$result->close();
Il problema è che io dovrei fare un confronto, per poi stampare a video due cose diverse.

Se l'array è correttamente popolato (se quindi ho passato i corretti user e password) allora stampa "OK", altrimenti stampa KO.

Ho provato a confrontare anche cosi, ma senza successo:

codice:
if($customer[idCustomer]!=NULL) {
 echo "id is not null... enjoy";
} else {
 echo "id is null";
}
Esegue il codice e stampa "id is not null"

se dovesse servire la query è questa...

codice:
'SELECT customers.idCustomer,
					nameShop,
					COUNT(membersCard.idCustomer) AS totalMembersCard
			FROM customers 
			LEFT JOIN membersCard ON customers.idCustomer = membersCard.idCustomer
			WHERE usernameCustomer = \''.$username.'\' AND passwordCustomer = \''.$password.'\'';
grazie in anticipo!