Jump to content

[SOLVED] How to find the last index in an array?


ballhogjoni

Recommended Posts

Does anyone know how to do this? I ask because I am generating a where clause for mysql and I can't have an AND at the end of the where clause.

 

Ex:

affiliate_id = "47" AND affiliate_id = "43" AND affiliate_id = "85" AND affiliate_id = "337" AND affiliate_id = "341" AND

 

my code

foreach( $aAffiliates as $key => $value ){
$sWhere .= 'affiliate_id = "'.$value['id'].'" AND ';
}

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.