Solved

Expand MySQL query in PHP code

Posted on 2011-09-29
1
336 Views
Last Modified: 2012-05-12
I have the following code that contains a MySQL snippet.  How do I alter this query to use an OR statement for column CoListingAgentNumber as well as the ListingAGentNumber and use $member_ids you see below:

      
$member_ids = explode(',',$mymemberid);
	foreach ($member_ids as $i=>$val) $member_ids[$i]="'$val'";
	$where_clause = "WHERE ListingAgentNumber in (".implode(',',$member_ids).")";

Open in new window

0
Comment
Question by:pda4me
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 36818983
I believe it could be:

$where_clause = "WHERE (ListingAgentNumber in (".implode(',',$member_ids).") OR CoListingAgentNumber in (".implode(',',$member_ids)."))";

Open in new window

0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question