Dreamweaver 8, PHP, multiple keyword search problem

Hello, I've successfully set up a search form, and a
recordset which retrieves results when a keyword is added to the
search form text field and the form is submitted. What I'm trying
to do is allow tourists to enter one or more keywords, such as
Istanbul Ankara, to get tours which include either or both of these
keywords. The search function works fine if I just put in one
keyword, like "Istanbul" or "istanbul." But if I enter two
keywords, there are no results, even though there are several tours
with both of these destinations in their itinerary. If I enter
istanbul AND ankara, I get results with the boolean method, but I
don't expect most of my site visitors to know how to do that.
Is there a way to modify the recordset, so that the user gets
results when they search with multiple keywords? Here's my SQL
code:

Ben Densin wrote:
> Is there a way to modify the recordset, so that the user
gets results when
> they search with multiple keywords?
Add a FULLTEXT index to the column that you want to search,
then change
the SQL like this:
WHERE MATCH (tours.long_itinerary) AGAINST ('keywords') AND
tour_category.cat_id=tours.category_id AND
tours.agency_id=travel_agency.agency_id
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Multiple Keyword Searching

    I am having trouble doing multiple keyword searches in aperture. Say for instance I tagged a photo with the word "Bob" and then with the word "Park". If I search for just Bob or just Park, I get all photos tagged with one or the other keyword. But if type into the keyword search bar: Bob, Park. No photos come up. I have tried several different ways of searching keywords. Anyone having the same problem or know how to fix it?

    The same is written in the [Aperture3 User Manual|http://documentation.apple.com/en/aperture/usermanual/index.html#chapter =14%26section=7%26tasks=true]; it doesn't work in Ap3 either. (The comma seems to be taken a literal character, not as a separator.)
    Ap3 lets one add additional filter rules, so that one could have two Text rules. (I never used Ap2.)
    Ap3 limits the keyword list to those keywords present in the currently selected container(s). So to at least check what you are doing -- if Ap2 does the same -- select or filter to a number of images with just a handful of keywords total, and see what you find out.
    Nice to see the sun for once.

  • Does endeca support multiple keyword search

    Am new to endeca.
    Does endeca support multiple keyword search in atg crs.
    an eg can we search for "shirt,shoes" and get results for both

    How specifically to implement this depends on how you are querying Endeca.  With a simple URL parameter query using the UrlENEQuery object you would set the parameter of Ntx=mode+matchany, and if you were using the ENEQuery class you would set it like:
    ENEQuery query = new ENEQuery();
    ERecSearchList searchList = new ERecSearchList();
    String matchMode = searchTerms.contains(",") ? "mode+matchany" : "mode+matchallpartial";
    ERecSearch search = new ERecSearch( "your-search-interface", searchTerms, matchMode );
    searchList.add( search );
    query.setNavERecSearches( searchList );
    If you are using the Assembler Service, you can include the Ntx parameter in the call, so you would wrap your call with some conditional logic, e.g.:
    String serviceCall = null;
    if( searchTerms.contains(",") ) {
       serviceCall = "assember/xml/browse?Ntt=shirt,shoes&Ntx=mode+matchany";
    } else {
      serviceCall = "assember/xml/browse?Ntt=shirt,shoes&Ntx=mode+matchallpartial";
    If you are using the Content Assembler API within your application, it will depend on how you are invoking it but some of the above should help you customise appropriately.
    HTH
    Michael

  • Endeca:Multiple keyword search

    I have integrated atg application with endeca and i implemented multiple keyword search.Now i am getting combined results.For eg:if i search for ice and shampoo i am getting combined results for both.I want to separate the results based on the search term in the front end?Please help.I am  using atg10.1.2
    Thanks  in advance

    Hi KannanMN,
    We will be getting the meta data related to the record in the results list saying why that particular record matched and retrieved. Using this information, you can populate or separate the results to go into two different div containers in the front end.
    Hope this helps.
    Keep posting the updates or questions.
    Thanks,
    Gopinath Ramasamy

  • PHP MYSQL KEYWORD SEARCH HELP

    Im creating a search for a image gallery and I want it to be able to pull up an image based on the keyword assigned to the image you searched. I have 4 fields in my DB, (id,layout"or image",description,key_words). My problem is when I enter a keyword in my textfield when the results page loads all I get is the field names (id,layout,description,key_words) instead of the actually data within those fields.
    I believe my problem lies within this line of code:
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text"));
    this code displays my DB field names, but not the data I inserted in those fields.
    So I tried changing the code to this:
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE '%$keyword%' ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text"));
    This code did display my mysql data, but not the data I entered in my textfield. With this code I don't even have to enter any keywords in the text field, I can simply click the search button and my mysql data would show up, even though I didn't enter a keyword...?
    Im very confused  I've been working on this off and on for  about a month now and have been in 3 different forums and know one seems to  be able to help. It would greatly appreciated if someone could help me  through this.
    Here is all my code for a better understanding:
    SEARCH PAGE:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="get" action="r.php">
      <label for="textfield"></label>
      <input type="text" name="keyword" id="textfield" />
      <input type="submit" name="button" id="button" value="search" />
    </form>
    </body>
    </html>
    RESULTS PAGE:
    <?php require_once('Connections/MyConnection.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset2 = 3;
    $pageNum_Recordset2 = 0;
    if (isset($_GET['pageNum_Recordset2'])) {
      $pageNum_Recordset2 = $_GET['pageNum_Recordset2'];
    $startRow_Recordset2 = $pageNum_Recordset2 * $maxRows_Recordset2;
    $colname_Recordset2 = "-1";
    if (isset($_GET['key_words'])) {
      $colname_Recordset2 = $_GET['key_words'];
    mysql_select_db($database_MyConnection, $MyConnection);
    $query_Recordset2 = sprintf("SELECT * FROM images2 WHERE key_words = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset2, "text"));
    $query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2);
    $Recordset2 = mysql_query($query_limit_Recordset2, $MyConnection) or die(mysql_error());
    $row_Recordset2 = mysql_fetch_assoc($Recordset2);
    if (isset($_GET['totalRows_Recordset2'])) {
      $totalRows_Recordset2 = $_GET['totalRows_Recordset2'];
    } else {
      $all_Recordset2 = mysql_query($query_Recordset2);
      $totalRows_Recordset2 = mysql_num_rows($all_Recordset2);
    $totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table>
      <tr>
        <td>id</td>
        <td>Layouts</td>
        <td>Descriptions</td>
        <td>key_words</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset2['id']; ?></td>
          <td><?php echo $row_Recordset2['Layouts']; ?></td>
          <td><?php echo $row_Recordset2['Descriptions']; ?></td>
          <td><?php echo $row_Recordset2['key_words']; ?></td>
        </tr>
        <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset2);
    ?>

    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE '%$keyword%' ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text")); 
    Why are you using the $keyword variable rather than the sprintf parameter? I don't know php, but it seems like that is your problem. Maybe try something like this:
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE %s ORDER BY id DESC", GetSQLValueString("%" . $colname_Recordset1 . "%",  "text"));

  • Multiple keyword search

    Hi all.
    Can anyone help me with the following? I have a search field where a user can enter more than one keyword. The keyword then is matched to one of 20 fields in the database. This works fine as long as only one keyword is entered, however I am having a problem separating the keywords so that the for each word entered the 20 fields are searched, ie if 2 keywords are entered the 20 fields will be searched twice.
    Any ideas? The following code snippet is working fine for one keyword.
    Thanks in advance
    El
    if (!MyStrEquals(Report, "")) sWhere += " AND (Report1 like '%" + Report + "%'";
    if (!MyStrEquals(Report, "")) sWhere += " or Report2 like '%" + Report + "%'";
    if (!MyStrEquals(Report, "")) sWhere += " or Report3 like '%" + Report + "%'";
    if (!MyStrEquals(Report, "")) sWhere += " or Report4 like '%" + Report + "%'";
    etc

    Thanks for this. I had started with a string tokeniser but seem to be missing something. I get an error
    Incompatible type for >. Can't convert boolean to int.
    and
    Can't convert java.util.StringTokenizer to java.lang.String.
    where am I going wrong?
    StringTokenizer Report = new StringTokenizer(Reports, " ");
    while (Report.hasMoreTokens() > 0) {
    Report.nextToken();
    if (!MyStrEquals(Report, "")) sWhere += " AND (Report1 like '%" + Report + "%'";
    if (!MyStrEquals(Report, "")) sWhere += " or Report2 like '%" + Report + "%'";

  • Bridge CS4 Keyword Search problems

    Hi everyone,
    I upgraded to Photoshop CS4 on the big day and have been trying to do some searches in Bridge. My keywords seemed to have transferred over from CS3 to CS4 just fine. At least, my files are showing the keywords I had tagged in CS3. The problem is that when I do a Find, no items are coming up. This happens whether I do Edit > /Find or use the new Quick Search bar. Anyone know if this is a bug? Or if there is something else I need to do?
    Thanks! :)
    Jan

    Hi Bart,
    Thanks for responding. :)
    Yes, I'm searching the current directory and I can see the keywords in the filter tab. I hadn't tried the spotlight-based search before. I just did that and that did work, even tho the Bridge-based search doesn't. So that's good. But searching on anything, even any elements of the filename, do not work for me using Find.
    But at least the spotlight based search works, so that will do.
    Thanks so much for your help, Bart. :)
    Jan

  • Anyone having keyword search problems?

    I'm using most recent vers. of Aperture and OS X.
    I'm getting different search results from 1) the Aperture keyword drop-down list (3000+ returned) and 2) the IPTC keyword field (100+ returned), even though I'm using the identical keyword: facades.
    The discrepancy between the two search is roughly the same with all stacks open and all stacks closed (obviously fewer returned when stacks are closed).
    Unfortunately, many of those returned using the drop-down list don't have the keyword "facades" in their keyword field!!
    Very puzzled. Are keywords treated differently in these two fields? But why would files be returned that don't have the keyword?
    I have (several times) carefully checked to see that only "facades" is checked in drop-down list.
    The drop-down list is: "include all of the following."
    The top line says: "include all of the following that match."

    May be that You have organized your keyword in a gerarchical mode, in such a way aperture give the response using the proper keyword and also the keyword that is superior in gerarchy.
    For instance if You have set keywords grouping together some keywords of animal, i.e. cat, dog, bird, and so on sub a title: "animal", then when you search the keyword "animal", You'll find all the photo that have the keyword underlying, i.e. cat, dog, bird and so on.

  • Keyword search on collection set not working for specific sub-collections

    I am having the following problem:
    When I do a search (Text->Keyword->Contains All-> for a keyword (in my
    case "Fave"), it does not work if I select the collection set that contains the
    collection that contains the images with that keyword.
    It DOES work if I select the folder, parent folder, or just the
    collection that contains the image. Just not the collection set.
    The details of how this came about are below - and are probably a
    little unusual, but not outside the realm of what should be allowed.
    Is there a way to reset/reindex keywords in a collection?
    Specifically:
    images lives in collection C1 which is part of collection set
    CS1. It lives in F1 (on disk and in LR) which is in parent folder
    PF1. A keyword search works when I select F1 or PF1 or C1, but NOT
    when I select CS1
    This happens on a set of folders that went through the following
    (totally allowable?) sequence:
    I am running on a Windows 7 64 bit machine with 64 bit LR3.3
    I have an internal disk where I keep my catalog and images. Windows
    mounts this as P:. I also mount it on my Desktop as the folder
    "Lightroom" (this allows me to change to a larger external disk
    by mounting it in the same place without changing the locations of
    all the files).
    I mistakenly imported pics into P:/PF1 rather than
    C:/.../Desktop/Lightroom/PF1 as I normally do.
    Added keywords made a collection C1 put the images in it, and added
    C1 to collection set CS1
    Having realized my import mistake (P: rather than
    C:/.../Desktop/Lightroom), I went in the Folders->P: section and did
    an Update Folder Location on F1 to C:/.../Desktop/Lightroom/F1
    This seemed to be all fine, but this weird Keyword search problem
    resulted.
    I have tried the following things:
    o Deleting and re-adding Keywords in the Collection
    o Deleting and re-adding the Keywords in the Folder
    o Renaming and relocating the Folder
    o Create new collection C2 and move pics from F1 into C2

    See my simplified recipe for reproducing this bug (which turns out not to be related to the drive mounting I described):
    http://forums.adobe.com/thread/764538

  • How to use Multiple Keywords in a Search Form?

    I'm currently using a bind variable on the view object to generate a search form where the user enters one keyword that is applied to the WHERE cause of the SQL query.
    The problem is I'm trying to implement a Google-type search, where the user can enter multiple keywords in a single text input area. I then want to parse out those keywords and search the database on each keyword (similar to a Google search.) Can someone please help me point me in the right direction as to where / how to code in the appropriate hooks to accomplish this?
    Example:
    (user input) Enter Search Keywords: keyword1 keyword2 keyword3.. keywordn
    database query:
    Select item from table where (desc like '%keyword1%') or .. (desc like '%keywordn%') or
    (category like '%keyword1%') or .. (category like '%keywordn%')

    Can't you parse what was entered and create a number of view criteria rows, then apply them? At that point, they would be 'OR'd together'.

  • Searching for multiple keywords

    Is there a way to fine tune a search---e.g. find all the photos with a certain keyword and then select out the ones I have marked with a check mark? When I try this I get all the photos that I ever marked with a check mark, not just the ones with the keyword or search term I've already searched on. I don't see an "advanced search" option with multiple search term options.

    Cynthia:
    Bring up the Keyword search pane and click on the checkmark button and then on the other keyword button. Only the photos with those two keywords will be displayed. The search box will show: √ and second keyword.
    If you use the Option key while selecting a keyword it will omit all photos from the search with that keyword. The search box will display √ and not second keyword.
    Happy New Year
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Couldnt work with multiple key fields in keyword search

    Hi,
    I have some issue while working keyword search uder free form search in datamanager. in my repository i have two keyfields name(default field) and nation(lookup flat). but while working with keyword search if i pass any value that is comparing with only the values under keyfield name not comparing with other keyfield nation values. i am working with MDM 5.5 sp6. It would be appreciable if any one solve this issue.
    Regards
    Ravi

    Hi Ravi,
    If you want to perform Keyword search for Nation field as well without changing it's field type; then plz follow these steps:
    1. Set the Keyword property for Nation Field as Normal in Main table.
    2. Now go to the lookup table to which Nation field is looking into (say the Lookup table name is Nations).
    3. Now set the Keyword property for Nation field as Normal in the lookup table (Nations table) as well.
    4. Go back to Main table and now perform Keyword search. This time it will perform the search on both the fields (i.e., Name as well as Nation).
    Please let us know, if problem still persists.
    Regards,
    Varun

  • Search for photos with multiple keywords

    I'm trying to figure out if it's possible to search for photos that have multiple keywords.   When selecting multiple keywords in a Bridge search the default behavior is to find photos that have any of the keywords rather than all of the keyword.  In other words I want to do an AND keyboard rather than an OR search.

    You should be able to do so in the find menu of Bridge (Edit/Find or cmd+F)
    With the plus sign you can add an extra (and) keyword to it.
    A shortcut may be to first find one keyword and then use the filter panel
    keyword section and select the other wished keywords by putting a checkmark
    in front, only the selected files will show in the content window.
    In other words I want to do an AND keyboard rather than an OR search.

  • Problem deleting multiple keywords in lightroom 5

    I am importing about 20,000 pictures from Flickr. they are all creative commons, and the end result will be the use of approximately 4000 of these in an online sign language dictionary.
    I use Bulkr to import them and this process imports the tags as well as other information such as the photographers name and url.  Many of these photos arrive with hundreds of tags, so that the total number of tags might be 20000 or more.  I need to assign my own tags and delete all the tags that the photo arrived with.  I use the lightroom batch delete to do this (the little minus sign at the top of the keyword list).  i select a keyword, hold down the shift key and scroll down.  the problem is that i cannot just scroll down to the bottom of the list.  There appear to be unpredictable keywords that cause the shift-select process not to work.  if i scroll back up and then carefully scroll part of the way back down, then there will be a point at which shift-select stops working and above that it works. 
    The end result of this is that it takes numerous shift-select-scroll down-select to delete everything so that what should take maybe 2 minutes takes 20 minutes or more. 
    The problem may be related to foreign language keywords especially chinese characters, but even what looks like a perfectly ordinary keyword can stop it.  Two recent examples: travellers cheque  and Київ. In all cases, the words can be deleted when i click directly on them.  you just cant shift-select THROUGH them.
    A separate annoyance that i will just grumble about is that i was forced to put these pictures in a separate catalog because there is always the risk that i could manage to delete my own keywords while batch-deleting everyone elses, and there is no simple way that i know of to undo this. with the separate catalog at least i wont delete all the keywords for my own pictures.

    With respect to problems deleting multiple keywords: On Windows, since at least version 3, LR has had basic bugs when you have more than about 1600 keywords showing.  (Hard to believe it isn't fixed by now.)   A simple workaround for you situation is to filter the keywords one letter at a time and then select the subset of keywords that are showing -- e.g. filter all keywords with the letter "t", then all keywords with the letter "b", etc.
    With respect to not getting the keywords into your catalog in the first place: You can define a Metadata Preset that will clear the keywords on import:

  • Keyword search in multiple folders

    May be a stupid question.....
    We want to have all of our photos stored on one server and then access them remotely and be able to do a keyword search to locate them later.
    We did a test with several folders but when we do a keyword search we have to be in the subfolder for Bridge to recognize the keyword.
    Example:
    Main Folder - Photos
      Sub Folder - Dan
      Sub Folder - Sara
    We put Dan as a keyword on all his photos and Sara on all of hers
    Then on the main folder do a keyword search for Dan and nothing comes up. Go into his subfolder and it works.
    We could just have one big folder with all of images loose in there, but that's not the best solution with multiple people putting images in there
    What am I doing wrong.
    Thanks for any insight.

    You should use the find command (cmd F) for this. Select keyword as criteria and be sure to check the option 'include subfolders'.
    You need to cache the folders first tlo get the most out of the speed for finding and the folders should all be in one main folder like pictures or so.
    Also be aware that Bridge on a server is not always a success and keep in mind that you are in fact looking for a Digital Asset Management system and DAM is not the best feature Bridge has to offer

Maybe you are looking for

  • Trying to upload a file to an ftp folder

    Hello, I am a recent convert to OS X from the Windows world and am trying to save a file on the ftp site for my work. I used the finder to connect to the FTP site, but I got an error saying that I couldn't change the file, when I tried to drop and dr

  • S_CTS_ADMI Authorization issue

    Hi Experts, Every now and again a user sends me a SU53 with the error requesting access to S_CTS_ADMI field TABL. The user of this morning is trying to release a purchase order using transaction ME29N. Why would the SU53 indicate that the user want t

  • Problem with picture synchronization in Outlook

    Hello. I have a problem with one of our users. We have a environment with Lync, SharePoint and Exchange.  One of our user changed his picture through SharePoint and from there it is synchronized with Active Directory. The sync between AD works fine.

  • HT1153 .wireless keyboard and mouse syncing to Mac mini

    I have a macmini and I'm having trouble syncing my keyboard and mouse to my computer. It's been synced to it before but it's not pairing now. How can I pair it when I don't have a USB mouse or keyboard

  • Phone in recovery mode after update???

    Update did not work, now i have discovered how to turn the phone back on as it wouldn't  it says i must restore it. Seriously?