Advanced search works only with verification of the equality of the sexes

Hi all

I don't know if this is something you can help me or if I'm missing something completely obvious.

I have a 'advanced search form' which has a few options to check through for example age, city, nationality, etc. and I have two sets of records, one for the user who has the gender are stored in $SameGenderCheck

And I have a SQL query for the search criteria for the search form.

Here's the SQL statement:

$query_search_res = "SELECT * FROM profiles LEFT JOIN profile_details ON profiles.profile_id = profile_details.profile_id WHERE (city = '$location') OR (ethnicity = '$ethnicity' OR nationality = '$nationality' OR marital_history = '$marital_history' OR height = '$height') AND (Age BETWEEN '$age_from' AND '$age_to') AND (gender != '$SameGenderCheck') AND (approved = 'Yes')";

Thank you.

> other search options are optional, so if they are entered, they will reduce more

> down search results if they are not then simply use age and city.

Okay, I think that it is actually the part that is causing problems for you. You want that all the criteria to NARROW your results.  You want to ethnicity, nationality, marital_history and the height to be optional criteria, so you have combined with the rest of the statement with a RC. But an OR condition will always expand results, not close. If you must change the first residence in one and. GOLD is used within the jurisdiction parens for these criteria are OK.

$query_search_res = "SELECT * PROFILES LEFT JOIN profile_details ON profiles.profile_id = profile_details.profile_id WHERE (city ="$location") AND (ethnicity = nationality GOLD" $ethnicity"="$nationality"marital_history ="$marital_history"height GOLD GOLD ="$height") AND (age BETWEEN '$age_from' AND '$age_to') AND (sex!» (= «$SameGenderCheck») AND (approved = "Yes");

But here's the problem; If the user has no entry for ethnic origin, nationality, the marital_history and the height of the criteria, no results will be returned. Regular SQL will not solve your problem. You can work around the problem by replacing the equality by the LIKE predicate operator and put a wildcard for users who do not have that criterion in their profile. But that works only for text fields, not digital, and I don't like.

A better solution is to dynamically create the WHERE clause, remove the criteria of ethnicity, nationality, marital_history and the height of the WHERE clause if the user does not have these fields completed.

Tags: Dreamweaver

Similar Questions

  • Is - this calculation Manager works only with EPMA?

    It seems calculation Manager works only with EPMA for the application of the classic plsnning, I cannot use the module of business rule and cannot use the Manager of computing to work on business rules, is good? correct me and advise, thank you!

    Sorry I disagree

    You can use the calc for classic version 11.1.1.3 planning
    When you create a planning application in 11.1.1.3 classic, you have the option to choose if you use business rules or calc for the app Manager.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm does not work with your new browser. It is very fustrating and works only with Windows Explorer. I need to reinstall the old FIREFOX program?

    RoboForm has already released a version with support for the latest version of Firefox. See http://www.roboform.com/support/news. Try upgrading to the latest version of Roboform.

  • Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? Every month I pay an amount for PS and LR...

    After the upgrade to Windows 10 Lightroom works only with reduced funktionality. Develop module is not available.  Adobe can not find the license associated with my Adobe why identification code? I bought the license more than 1 year ago. Every month I pay an amount for PS and LR, and for the past 4 months I can't work. Russian support team cannot solve this problem and sent me here.

    Thank you! I reset my password, the problem was in it.

  • CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 Production Premium supports AMD graphics cards? Specifically over-pants M6100. If so, all the features work with the M6100, or are there features that work only with nVidia video cards?

    CS6 does support OpenCL and OpenGL?

    Are all features that CS6 supports for NVidia Cuda available for the M6100 OpenCL?

    Bill supposed to first Pro CC (not CS6) response. Windows of Premiere Pro CS6 version does not support OpenCL for accelerating GPU of MPE. Therefore, there is no "opencl_supported_cards.txt" file in the folder of Premiere Pro, and the code to OpenCL is disabled permanently in all versions of Windows from Premiere Pro CS6. So, for your over-pants M6100 Premiere Pro CS6 will be permanently locked to only software MPE mode. (Acceleration GPU of MSES in the Windows of Premiere Pro CS6 version is limited to the CUDA only, which means that only NVIDIA for GPU - no AMD over-pants or GPU Radeon support CUDA at all.)

  • I have the code for an Adobe Creative Cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code?

    Hi, I have a problem with code for my Adobe Creative cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code? is a subscription to creative cloud of throughout the year.

    Probably you have a redemption code... especially if you did not purchase directly from Adobe

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

    -or https://forums.adobe.com/thread/1572504

  • DeskJet 722C works only with Windows 7

    OK, so I applied the DJ_Patch as described. (See http://h30434.www3.hp.com/t5/Printer-All-in-One-Software-and/Deskjet-710-720-810-820-100-Series-prin... ) I have Windows 7, 64-bit and a HP Deskjet 722 C printer.  Tried to print the test page, but received the error from the printer.  Tried to add a printer, you are looking for the 722C, but it is not on the list, even tried to do Windows Update to search for my printer.   Tried to restart, which did not work or the other.  Still get error printer.  I appreciate any other suggestions.  BTW, the printer is connected via a USB to parallel port cable.

    My HP Deskjet 722C now works!  I spent several hours trying different things only to find out it was the cable use to connect the printer to our new computer.  He is there not a lot of info on the package of cable but if you watched closely he said it worked only with Win XP, me and Vista.  Who would have thought that the cable wasn't working with some BONE... me!  Once we went and bought a new cable ($40, Ouch!), we were running a few minutes.  I don't know that a cheaper cable is available online.

    I wanted to post this in the hope of saving someone money, time and frustration on the other.

  • Windows 7 works only with canon MX 340

    Canon MX 340 printer works only with windows 7.

    Canon MX 340 printer works only with windows 7.

    You mean the Canon PIXMA MX340?

    You have the following drivers installed? :
    http://www.USA.Canon.com/nw3s/CanonUSA/DownloadContents/English/0100461601EN.htm
    (As of 10/23/12)

  • External speakers work only with powerpoint.

    External speakers work only with powerpoint. DVD, internet, music files, are not. They worked for the first few weeks.

    I have a HP dv7-6c27cl with intel core i5 and Windows 7.

    When I have the system check it, it finds no problem.  Apparently, I have the latest drivers. The fact that the speakers work with powerpoint, which is confusing.

    When I play a video file or music, I get an error message: "Windows Media Player has encountered a problem while playing the file."

    The headset works for internet but not DVD.

    I've installed Weatherbug a week ago and had to uninstall other garbage that come with it. I think that's when the problem started.

    Well, I set myself just now. I did a system restore to a point before that I installed Weatherbug, and now everything's fine.

  • Adobe Acrobat dc works only with Microsoft office 2016

    Adobe Acrobat dc works only with Microsoft office 2016

    Hey Nick Villani,

    Desktop stand 2016 for Windows and MAC OS versions of Acrobat DC will be available in the next major update quarterly Acrobat, tentatively scheduled for October.

    Kind regards

    Ana Maria

  • This calculator works only with round numbers

    I need help,

    This calculator works only with the numbers series, but is this 1.9 * 6 the result is 11.399999999999999 instead of 11.4

    Ware is the problem, can it be resolved?

    Theanks in advace.

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "layout =" " vertical " >

    < mx:Script >

    <! [CDATA]

    private function getTotal():Sub

    {

    var myInt:int = parseInt (input.text);

    var myFloat:Number = parseFloat (input.text);

    var myNumber:Number = new Number (Input.Text);

    var myInt2:int = parseInt (input2.text);

    var myFloat2:Number = parseFloat (input2.text);

    var myNumber2:Number = new Number (INPUT2. (Text);

    total. Data = (myNumber) * (myNumber2);

    }

    []] >

    < / mx:Script >

    < mx:TextInput id=" entry " />

    < mx:TextInput id=" INPUT2 " />

    < mx:TextInput id=" total " />

    < mx:Button " label = ' Button "click ="getTotal ();" />

    < / mx:Application >

    Welcome to the joys of IEEE 754 floating-point arithmetic. For more fun, try ".1 + 1 - 1»

    The simplest answer is probably to limit your result with Number.toFixed (). The answer is not so easy is to write your own class BigDecimal (in Java).

    --
    Maciek Sakrejda
    Truviso, Inc..
    www.truviso.com
    Truviso recruiting: http://www.truviso.com/company-careers.php?i=87

  • I downloaded the version track cs6 and works only. It displays the error "not found entry point"

    I downloaded the version track cs6 and works only. It displays the error "not found entry point"

    Your computer does not meet the system requirements. Refer to the card tech on the product page.

    Mylenium

  • Samsung 850 EVO Solid State Drive works only with the MacBook Pro - Solution?

    I recently bought a Samsung 850 EVO 500 GB Solid State Drive for mid 2012 MacBook Pro father. The computer was working properly, but it was just very slow. I took the old drive and installed the SSD. I took it to an Apple store so that they could install the OS. A guy at the Genius Bar met with me and first tried to install the OS via the Ethernet cable. It is impossible to install some general error. He then tried to install it on a disc. Which also failed. He said he was not familiar with the type of error that he saw. But he said it was a mistake 'bad '. He said he saw the SSD for my SATA cable worked. He concluded that the reader must be defective. I explained how it is virtually impossible because they have a rate of close to zero. He said: "well they are produced en masse" and explained how they could install a hard drive themselves for some too expensive price. A bit annoying.

    In any case, I took the SSD back to my house and threw it in my desktop PC. It works very well. Then what should I do? Why am I not able to get the SSD to install it? From what I read, the Samsung 850 EVO should be compatible with a MacBook Pro 2012. Can I do to install it at home? Is that all I can say people at the Mac store to help them along?

    Most likely, the drive is formatted for use with Windows computers. First step would be to format correctly for Macs.

    This is Mac OS extended (journaled) with a GUID partition map.

    OS X will only be installed on a properly formatted disk.

    HTH

    Leo

  • HP Pavilion p6709c desktop PC: new Gtx 750ti works only with the P6000

    After the installation of the new card, I'm stuck on the blue HP logo screen with without work duties and eventually a loud beep.

    Here are the steps I've tried currently:

    Swapped the psu of 300w for a compatible with rails needed 12v 430w

    Update the bios to 7.15 (highest possible, although I read it 8 + can be required to work)

    Tried loading after the bios changes: security disabled on PCI 16 - causing a black screen loading of the integrated graphics card unless.

    People with disabilities integrated graphics

    Uninstalled old gt 430 Moose used video card drivers.

    Installed new Nvidia drivers for the 750ti

    Talked to Zotac support, they said that HP has several locks of their boards of Directors that will not allow this works.

    Not sure if I should try to change in order to load legacy/uefi or just give up and send everything back.

    Going to leave this publication until tonight to make a decision.

    Thanks in advance for any help.

    The GTX 750TI is supposed to be compatible with a 300W.  The real problem comes from your lack of the UEFI BIOS revision 8, which is not available for your system. It's refreshing having HP slam Zotac!   The MSI 750TI has a UEFI and pass the legacy.  The EVGA GTX660 or GTX670, line 1 (888) 880-3842), is a better card, but you need at least a 600W PSU for flexibility.

  • Application works only with the WAP. good with wifi

    My application works fine with wifi connection, but does not not with WAP GPRS.

    + 2 days devoted to this subject, but no success.

    Here's the code...

    Hi mantaker, yet I don't have the solution to my previous problem.

    my application using httpconnection and his fine work with Wi - Fi (the device). obtain data from the servlet. I want to use GPRS EDGE. I tried the very last day. but it's not working. even I had the name of the apn, the user name and the password. but it's not working with GPRS. Deploy the NetworkDiagnosticPublic application on device even his also does not work with WAP. and not getting not response. only works with wifi. Here is my code. n my wifi connection successfully application, but I want to do with the GPRS Edge code is

    connThread.get("http://*********.30daytrial.webappcabaret.com/Zain_Servlet/second?f1="                            + NameTextField.editField.getText()                            + "&m2="                            + AreaTextField.editField.getText()                            + "&l2="                            //+ LastTextField.editField.getText());//NOT WORKING                            //+ LastTextField.editField.getText() + ";deviceside=true;ConnectionUID=" + getWap2TransportUid());//NOT WORKING                            + LastTextField.editField.getText() + ";deviceside=true");//NOT WORKING                            //+ LastTextField.editField.getText() + ";interface=wifi");// WORKING                            //+ LastTextField.editField.getText() + ";deviceside=true;apn=internet;" +                            //"TunnelAuthUsername=internet;TunnelAuthPassword=internet");//NOT WORKING
    
       private static String getWap2TransportUid() {
    
         // Get the service book records for WAP2 transport.          ServiceRecord[] records = ServiceBook.getSB().findRecordsByCid("WPTCP");
    
              for (int i = 0; i < records.length; i++){
    
                  Dialog.alert("Service: " + records[i].getName());         }
    
               for (int i = 0; i < records.length; i++)           {             ServiceRecord serviceRecord = records[i];             String cid, uid;
    
                  if (serviceRecord.isValid() && !serviceRecord.isDisabled()) {                 cid = serviceRecord.getCid().toLowerCase();                   uid = serviceRecord.getUid().toLowerCase();
    
                  if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") == -1 && uid.indexOf("mms") == -1) {                    Dialog.alert("New ::  "+serviceRecord.getUid());                  return serviceRecord.getUid();                    }             }            /* String recordName = serviceRecord.toString().toUpperCase();             if (serviceRecord.isValid() && !serviceRecord.isDisabled() &&                     serviceRecord.getUid() != null && serviceRecord.getUid().length() != 0 &&                     recordName.indexOf("WAP2")!=-1)
    
                   {                 Dialog.alert("recordName: " + recordName);                     String uid = serviceRecord.getUid();                    Dialog.alert("UID="+uid.getBytes());
    
                       return uid;               }*/           }
    
              return null;  } 
    


    Yes peter, there are a lot of thread having the same issues...

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=38541#M38541

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=38328#M38328

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=38316#M38316

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=38157&view=by_date...

    always loads UN stuck

    See you soon...

Maybe you are looking for

  • Point to the new terms of AGREEMENT?

    I've read and if all goes well digested the new conditions but could not find the usual point of AGREEMENT.   Sent an email too.   Cannot install latest iPad Apps - password for iTunes help refusal

  • Signature in other Microsoft services signs you on Skype?

    Then, I discovered something curious. This is an intermittent problem that is faced with a lot of people. The problem is that you are randomally and without apparent reason being disconnected (e) Skype. Since the update to Skype 6.18 on Windows 7, I

  • Y50 - 70-3 USB is too slow

    HelloRecently I bought Lenovo Y5070 have 1 TB HDD (5400 rpm) + 8 SSD and when I connect my hard on the USB 3 speed, I got it external is 16 MB per second. So what's the problem I've encountered here? This is on windows or on usb portalso, when I conn

  • A problem on Windows 2000 Pro SP4

    When I go to certain sites like facebook for example a bsod appears and restart windows and I don't know why? Help, pleaseThe following data in the bsod dump files: ==================================================Dump file: Mini010414 - 01.dmpCrash

  • How to transfer data to a remote executable?

    Hi every1, We make an application where we use 4 PC. I have a panel (Hardware) connected to a PC. I wish to convey my material data to PC remotely. For this, I used "Open Application Ref". It works very well. But when I make an exe it gives me error.