add an and

hello there,
Im using this to check one database but how can I have (db_site1, db_site2, db_site3)
if($database_rec[0] == 'db_site1') continue;

Open in new window

LVL 1
XK8ERAsked:
Who is Participating?
 
Roger BaklundConnect With a Mentor Commented:
Sorry, I mismatched the parantheses, it is missing an ) at the end:
if(in_array($database_rec[0],array('db_site1','db_site2','db_site3'))) continue;
 
# alternative:
if($database_rec[0] == 'db_site1') continue;
if($database_rec[0] == 'db_site2') continue;
if($database_rec[0] == 'db_site3') continue;
 
# alternative 2:
if(($database_rec[0] == 'db_site1') or 
   ($database_rec[0] == 'db_site2') or 
   ($database_rec[0] == 'db_site3')) continue;

Open in new window

0
 
Roger BaklundCommented:
Try this:
if(in_array($database_rec[0],array('db_site1','db_site2','db_site3')) continue;

Open in new window

0
 
XK8ERAuthor Commented:
I tried this but it didnt work.. is there another way of doing it?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.