Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Option Listings with Advanced Filter?

 

 


nmsinc
User

Jan 18, 2012, 7:24 PM

Post #1 of 4 (355 views)
Shortcut
Option Listings with Advanced Filter? Can't Post

I'm populating a dropdown with files from another field using the advance filter. When using the code below it returns and populates every listing when I only desire those that are labled as "Insurance Dispatcher" or "Dispatcher/Adjuster" - Any suggestions - anyone?

SELECT num, fullname
FROM `<?php echo $TABLE_PREFIX ?>accounts`
WHERE `member_company_accounts` = '<?php echo $ESCAPED_FILTER_VALUE ?>' AND user_type = ('Insurance Dispatcher' || 'Insurance Dispatcher/Adjuster')


Dave
Staff / Moderator


Jan 18, 2012, 8:12 PM

Post #2 of 4 (354 views)
Shortcut
Re: [nmsinc] Option Listings with Advanced Filter? [In reply to] Can't Post

Hi nmsinc,

Try this:

Code
SELECT num, fullname  
FROM `<?php echo $TABLE_PREFIX ?>accounts`
WHERE `member_company_accounts` = '<?php echo $ESCAPED_FILTER_VALUE ?>'
AND user_type IN('Insurance Dispatcher', 'Insurance Dispatcher/Adjuster')


And see:
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_in

Hope that helps! Let me know if that works for you or if you have any other questions.

Dave Edis - Senior Developer
interactivetools.com
 


nmsinc
User

Jan 19, 2012, 5:37 AM

Post #3 of 4 (342 views)
Shortcut
Re: [Dave] Option Listings with Advanced Filter? [In reply to] Can't Post

Hi Dave,

Thanks for the help, it worked perfect. I also have another thread reagaring the code below that has not been answered. I need to populate a dropdown as you can see below using the Advance query; however, I receive a SQL syntax error when I use it.

<select name="company_type">
<option value="Insurance">Insurance</option>
<?php if ($CURRENT_USER['isAdmin']):?>
<option value="Independent">Independent</option>
<?php endif; ?>
</select>


Dave
Staff / Moderator


Jan 19, 2012, 7:41 AM

Post #4 of 4 (335 views)
Shortcut
Re: [nmsinc] Option Listings with Advanced Filter? [In reply to] Can't Post

Sure, I've posted a question on the other thread and we can continue that conversation there. I'm sure we can figure something out to get it working.

Dave Edis - Senior Developer
interactivetools.com