37 Replies Latest reply: Apr 16, 2012 9:24 AM by Jonathan Fortis RSS

    search results displaying all records, please help

    Jonathan Fortis Community Member

      i did post this before but didnt have any luck I have used my search script before but tried it again and it is returning ALL the results from the DB..Can anyone see what i am missing?

       

      $var_SalaryReq_Recordset1 = "%";

      if (isset($_GET['SalaryReq'])) {

        $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];

      }

      $var_skills_offered_Recordset1 = "%";

      if (isset($_GET['skills_offered'])) {

        $var_skills_offered_Recordset1 = $_GET['skills_offered'];

      }

      $var_location_Recordset1 = "%";

      if (isset($_GET['location'])) {

        $var_location_Recordset1 = $_GET['location'];

      }

      $var_PositionReq_Recordset1 = "%";

      if (isset($_GET['PositionReg'])) {

        $var_PositionReq_Recordset1 = $_GET['PositionReg'];

      }

      mysql_select_db($database_hostprop, $hostprop);

      $query_Recordset1 = sprintf("SELECT userid, FirstName, Surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1, "text"));

      $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);

      $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());

      $row_Recordset1 = mysql_fetch_assoc($Recordset1);

       

      the search feilds are

       

                  <input name="PositionReq" type="text" class="textfeilds" value="Job Title" size="32" />

                  <input name="skills_offered" type="text" class="textfeilds" value="Skills Required" size="32" />

                  <input name="SalaryReq" type="text" class="textfeilds" value="Salary Offered" size="32" />

                  <input name="location" type="text" class="textfeilds" value="Location" size="32" />

       

       

      thanks in advance

        • 1. Re: search results displaying all records, please help
          bregent MVP

          >SELECT userid, FirstName, Surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup

          >WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s

           

          That query will only work if the user enters values in all fields, right? Otherwise it will return all rows. How are you testing this?

          • 2. Re: search results displaying all records, please help
            Jonathan Fortis Community Member

            Thats correct, if user inputs a search into only one feild it returns all results, I want it to work if even only one search box is used, I used this logic before and it works fine, but this time it doesnt

            • 3. Re: search results displaying all records, please help
              bregent MVP

              You could not have used the same logic successfully before - it simply will not work. You are using the LIKE predicate and OR keywords separating your conditions. And you are setting the default value to the SQL wildcard. So if a user doesn't enter a value in a field, all rows from the table will match.

               

              As I have said before, the best way to solve this is to dynamically build the WHERE clause. You add each field to the WHERE clause only if the user entered a value. Another option, and a bit of a kludge in my option, is to set the default value to something that you know will never appear in the table values, like "XXXXXXX".

               

              Also, not related to your problem, but I notice that your skills_offered field is not appending the wildcard to the end. Not sure if this was intentional.

              • 4. Re: search results displaying all records, please help
                Jonathan Fortis Community Member

                this is the statment from the previous search that works how i need it

                 

                $var_tk_job_title_Recordset1 = "%";

                if (isset($_GET["tk_job_title"])) {

                  $var_tk_job_title_Recordset1 = $_GET["tk_job_title"];

                }

                $var_tk_job_location_Recordset1 = "%";

                if (isset($_GET["tk_job_location"])) {

                  $var_tk_job_location_Recordset1 = $_GET["tk_job_location"];

                }

                $var_tk_job_salary_Recordset1 = "%";

                if (isset($_GET["tk_job_salary"])) {

                  $var_tk_job_salary_Recordset1 = $_GET["tk_job_salary"];

                }

                mysql_select_db($database_hostprop, $hostprop);

                $query_Recordset1 = sprintf("SELECT tk_job_title, tk_job_location, tk_job_salary, LEFT(tk_job_desc,200) as truncated_job_desc FROM think_jobsearch WHERE tk_job_title LIKE %s OR tk_job_location LIKE %s OR tk_job_salary LIKE %s", GetSQLValueString("%" . $var_tk_job_title_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_tk_job_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_tk_job_salary_Recordset1 . "%", "text"));

                $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);

                $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());

                $row_Recordset1 = mysql_fetch_assoc($Recordset1);

                 

                and thats why i replicated it for the new search

                 

                >As I have said before, the best way to solve this is to dynamically build the WHERE clause. You add each field to the WHERE clause only if the user entered a value.

                 

                was this in a previous post?

                 

                .>Also, not related to your problem, but I notice that your skills_offered field is not appending the wildcard to the end. Not sure if this was intentional

                 

                no this was not intentional, i have amended this

                • 5. Re: search results displaying all records, please help
                  Jonathan Fortis Community Member

                  also i tried using the xxxxx as the defualt value instead of the SQL wildcard % and no results are displayed??

                  • 6. Re: search results displaying all records, please help
                    bregent MVP

                    Can you show me the complete script where you have the default values set to 'xxxxxxx' and tell us what values are being entered in the search criteria when no results are displayed. Also include the code from your search form.

                    • 7. Re: search results displaying all records, please help
                      Jonathan Fortis Community Member

                      $currentPage = $_SERVER["PHP_SELF"];

                       

                       

                      $maxRows_Recordset1 = 5;

                      $pageNum_Recordset1 = 0;

                      if (isset($_GET['pageNum_Recordset1'])) {

                        $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];

                      }

                      $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

                       

                       

                      $var_SalaryReq_Recordset1 = "xxxxx";

                      if (isset($_GET['SalaryReq'])) {

                        $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];

                      }

                      $var_skills_offered_Recordset1 = "xxxxx";

                      if (isset($_GET['skills_offered'])) {

                        $var_skills_offered_Recordset1 = $_GET['skills_offered'];

                      }

                      $var_location_Recordset1 = "xxxxx";

                      if (isset($_GET['location'])) {

                        $var_location_Recordset1 = $_GET['location'];

                      }

                      $var_PositionReq_Recordset1 = "xxxxx";

                      if (isset($_GET['PositionReg'])) {

                        $var_PositionReq_Recordset1 = $_GET['PositionReg'];

                      }

                      mysql_select_db($database_hostprop, $hostprop);

                      $query_Recordset1 = sprintf("SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"));

                      $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);

                      $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());

                      $row_Recordset1 = mysql_fetch_assoc($Recordset1);

                       

                       

                      if (isset($_GET['totalRows_Recordset1'])) {

                        $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];

                      } else {

                        $all_Recordset1 = mysql_query($query_Recordset1);

                        $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);

                      }

                      $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

                       

                       

                      $queryString_Recordset1 = "";

                      if (!empty($_SERVER['QUERY_STRING'])) {

                        $params = explode("&", $_SERVER['QUERY_STRING']);

                        $newParams = array();

                        foreach ($params as $param) {

                          if (stristr($param, "pageNum_Recordset1") == false &&

                              stristr($param, "totalRows_Recordset1") == false) {

                            array_push($newParams, $param);

                          }

                        }

                        if (count($newParams) != 0) {

                          $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));

                        }

                      }

                      $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

                       

                       

                       

                      the form is

                       

                                  <input name="PositionReq" type="text" class="textfeilds" value="Job Title" size="32" />

                                  <input name="skills_offered" type="text" class="textfeilds" value="Skills Required" size="32" />

                                  <input name="SalaryReq" type="text" class="textfeilds" value="Salary Offered" size="32" />

                                  <input name="location" type="text" class="textfeilds" value="Location" size="32" />

                       

                       

                      examples of search criteria are job title would be say police officer, location would be say london

                       

                      when using xxxx no results are being dispalyed

                      • 8. Re: search results displaying all records, please help
                        bregent MVP

                        Please, I need to see the entire form, everything between and including the FORM tags.

                        • 9. Re: search results displaying all records, please help
                          Jonathan Fortis Community Member

                          <form id="form3" name="form3" method="post" action="../candidate-search-results.php">

                                    <p>

                                      <input name="PositionReq" type="text" class="textfeilds" value="Job Title" size="32" />

                                      <input name="skills_offered" type="text" class="textfeilds" value="Skills Required" size="32" />

                                      <input name="SalaryReq" type="text" class="textfeilds" value="Salary Offered" size="32" />

                                      <input name="location" type="text" class="textfeilds" value="Location" size="32" />

                                       

                          <td colspan="2"><img name="CANDSEARCH_r1_c1_s1" src="../images/CANDSEARCH_r1_c1_s1.png" width="74" height="5" border="0" id="CANDSEARCH_r1_c1_s1" alt="" /></td>

                                        <td rowspan="3"><a href="../candidate-search-results.php" onmouseout="MM_nbGroup('out');" onmouseover="MM_nbGroup('over','CANDSEARCH_r1_c3_s1','images/CANDSEARCH_r1_c3_s2.png','im ages/CANDSEARCH_r1_c3_s4.png',1);" onclick="MM_nbGroup('down','navbar1','CANDSEARCH_r1_c3_s1','images/CANDSEARCH_r1_c3_s3.pn g',1);">

                                          <input type="image" src="../images/CANDSEARCH_r1_c3_s1.png" width="50" height="17" border="0" id="CANDSEARCH_r1_c3_s1" alt="" />

                           

                           

                                  </form>

                          • 10. Re: search results displaying all records, please help
                            Jonathan Fortis Community Member

                            i have just noticed something there is a double line to the ../candidate-search-results.php

                             

                            one is the form tag and the other in the search image, would this be the problem?

                            • 11. Re: search results displaying all records, please help
                              Jonathan Fortis Community Member

                              Is the above what u needed, I re

                              moved the other button link but that di

                              dnt do anything

                              • 12. Re: search results displaying all records, please help
                                bregent MVP

                                Look at the code. What method are you using to submit the form? What method are you using to retrieve the form values !

                                • 13. Re: search results displaying all records, please help
                                  Jonathan Fortis Community Member

                                  OK,i see that when i posted to the thread, i have now changed the form to GET but it is still not working, if i change the default value to the wildcard % it displays all the results but if i change it to xxxxx i get no results, so i know the way the form was sent was incorrect but now being changed i am still getting the same results.

                                  • 14. Re: search results displaying all records, please help
                                    bregent MVP

                                    So now you need to start troubleshooting by echoing values to the screen. Start by outputting $query_Recordset1 and paste the results here.

                                    • 15. Re: search results displaying all records, please help
                                      Jonathan Fortis Community Member

                                      i put an echo at the end of the script, i then done a search on the location and the echo gave the following resutls

                                       

                                      SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%%%' OR PositionReq LIKE '%%%' OR location LIKE '%%%' OR skills_offered LIKE '%%%'

                                      • 16. Re: search results displaying all records, please help
                                        bregent MVP

                                        Where is the submit button on your form?

                                        • 17. Re: search results displaying all records, please help
                                          Jonathan Fortis Community Member

                                          i have added the submit value as below

                                           

                                          <input type="image" src="../images/CANDSEARCH_r1_c3_s1.png" width="50" height="17" border="0" value="Submit" id="CANDSEARCH_r1_c3_s1" alt="" />

                                           

                                          and still showing the same as before

                                          • 18. Re: search results displaying all records, please help
                                            bregent MVP

                                            ><input name="location" type="text" class="textfeilds" value="Location" size="32" />

                                             

                                            Why are you populating a value in the text field? How are you clearning that out before submitting?

                                             

                                             

                                            >SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName,

                                            >Surname FROM think_signup WHERE SalaryReq LIKE '%%%' OR PositionReq LIKE '%%%'

                                            >OR location LIKE '%%%' OR skills_offered LIKE '%%%'

                                             

                                            This tells me that your default value is still '%' and you have NOT changed it to 'xxxxx'.  Or, you are using some unposted method to populate it with '%'.

                                            • 19. Re: search results displaying all records, please help
                                              Jonathan Fortis Community Member

                                              >Why are you populating a value in the text field? How are you clearning that out before submitting?

                                               

                                              this is to show the user what to input, i am not clearing it before submission (this is the same as the other search that working)

                                               

                                              sorry i was trying something i have changed the values back and done another echo test

                                               

                                              SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%xxxxx%' OR PositionReq LIKE '%xxxxx%' OR location LIKE '%xxxxx%' OR skills_offered LIKE '%xxxxx%'

                                              • 20. Re: search results displaying all records, please help
                                                bregent MVP

                                                Submit the form, and then copy the url from the address bar and post it here.

                                                 

                                                 

                                                >this is to show the user what to input, i am not clearing it before submission (this is the same as the other search that working)

                                                 

                                                The only reason it appears to be working is because the default values you put into those fields has not yet appeared in your data. But this is obviously a very poor practice that will eventually lead to trouble. You must always clear out that data before posting.

                                                • 21. Re: search results displaying all records, please help
                                                  Jonathan Fortis Community Member

                                                  http://www.rerecruitment.co.uk/beta/candidate-search-results.php

                                                   

                                                   

                                                  it isnt passing any of the information

                                                   

                                                   

                                                  the other search that is working is giving the following results

                                                   

                                                  current-positions.php?tk_job_title=security&tk_job_location=Location&tk_job_salary=Salary& x=87&y=5

                                                   

                                                   

                                                  again here is the echo

                                                   

                                                  SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%xxxxx%' OR PositionReq LIKE '%xxxxx%' OR location LIKE '%xxxxx%' OR skills_offered LIKE '%xxxxx%'


                                                  • 22. Re: search results displaying all records, please help
                                                    bregent MVP

                                                    Are you sure you changed the form method to GET? It appears that you have not.

                                                    • 23. Re: search results displaying all records, please help
                                                      Jonathan Fortis Community Member

                                                      <form id="form3" name="form3" method="get" action="../candidate-search-results.php">

                                                      • 24. Re: search results displaying all records, please help
                                                        Jonathan Fortis Community Member

                                                        ok it seem to be a problem with the submit graphic, i will change the image, i tried it with a standard button and it worked.

                                                         

                                                        thanks

                                                         

                                                        just a quick one though,

                                                         

                                                        should i change the other search page to xxxx rather than the wildcard?

                                                        • 25. Re: search results displaying all records, please help
                                                          Jonathan Fortis Community Member

                                                          its strange becuase some of the feilds are working the job title isnt working and neither is the skills required but the salary offered and location are working now

                                                          • 26. Re: search results displaying all records, please help
                                                            bregent MVP

                                                            >should i change the other search page to xxxx rather than the wildcard?

                                                             

                                                            I can't comment without knowing all of the details. If you are using AND to combine conditions, then you probably want to continue using the wildcard. In any case, I wouldn't put default text in the form fields. Use labels to help the user complete the form.

                                                            • 27. Re: search results displaying all records, please help
                                                              bregent MVP

                                                              >its strange becuase some of the feilds are working the job title isnt working

                                                              >and neither is the skills required but the salary offered and location are working now

                                                               

                                                              When you are not getting the expected results, we need to see the SQL submitted - every time.

                                                              Echo the $query_Recordset1  variable and post the results.

                                                              • 28. Re: search results displaying all records, please help
                                                                Jonathan Fortis Community Member

                                                                in the db i have an input called security in the PositionReq field, then in the skills_offered i have an input called fireman     in the SalaryReq feild i have a neg result and for locatio i have test 12 stored

                                                                searching for jobtitle for security

                                                                 

                                                                SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%Salary Offered%' OR PositionReq LIKE '%Skills Required%' OR location LIKE '%Location%' OR skills_offered LIKE '%xxxxx%'

                                                                 

                                                                this has no results

                                                                 

                                                                this looks like something is going wrong here??

                                                                 

                                                                searching skills required for fireman

                                                                 

                                                                SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE

                                                                '%Salary Offered%' OR PositionReq LIKE '%fireman%' OR location LIKE '%Location%' OR skills_offered LIKE '%xxxxx%'

                                                                 

                                                                this has no results

                                                                 

                                                                searching salary required for NEG

                                                                 

                                                                SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%neg%' OR PositionReq LIKE '%Skills Required%' OR location LIKE '%Location%' OR skills_offered LIKE '%xxxxx%'

                                                                 

                                                                a result is displayed

                                                                 


                                                                searching for test 12

                                                                 

                                                                SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE '%Salary Offered%' OR PositionReq LIKE '%Skills Required%' OR location LIKE '%test 12%' OR skills_offered LIKE '%xxxxx%'

                                                                 

                                                                a result is displayed

                                                                • 29. Re: search results displaying all records, please help
                                                                  bregent MVP

                                                                  >SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName,

                                                                  >Surname FROM think_signup WHERE SalaryReq LIKE '%Salary Offered%' OR PositionReq

                                                                  >LIKE '%Skills Required%' OR location LIKE '%Location%' OR skills_offered LIKE '%xxxxx%'

                                                                  >

                                                                  >this has no results

                                                                   

                                                                  Right. Are you expecting a result? You have no search criteria entered, other than the default values you have in the form fields.

                                                                   

                                                                  >SELECT SalaryReq, skills_offered, location, PositionReq, otherComments, userid, FirstName, Surname FROM think_signup WHERE SalaryReq LIKE

                                                                  >'%Salary Offered%' OR PositionReq LIKE '%fireman%' OR location LIKE '%Location%' OR skills_offered LIKE '%xxxxx%'

                                                                  >

                                                                  >this has no result

                                                                   

                                                                  Right. You are searching for 'fireman' in the PositionReq column, but you stated above that it is in the skills_offered column.

                                                                   

                                                                  Why does PositionReq  SalaryReq use proper case naming, while skills_offered uses lower case with an underscore?  Things are a real mess! We've already found about a dozen errors in your code for this relatively simple search form.

                                                                  • 30. Re: search results displaying all records, please help
                                                                    Jonathan Fortis Community Member

                                                                    >Right. Are you expecting a result? You have no search criteria entered, other than the default values you have in the form fields.

                                                                     

                                                                    i did put an input of security, i dont know why it isnt showing any results

                                                                     

                                                                    Right. You are searching for 'fireman' in the PositionReq column, but you stated above that it is in the skills_offered column.

                                                                     

                                                                    i see that now!, this is a mess

                                                                     

                                                                    Why does PositionReq  SalaryReq use proper case naming, while skills_offered uses lower case with an underscore?  Things are a real mess! We've already found about a dozen errors in your code for this relatively simple search form.

                                                                     

                                                                    I dont understand how it has got like this. Is is a problem ( i know its not good practice) to  have an underscore

                                                                     

                                                                    or should i go back and start again

                                                                    • 31. Re: search results displaying all records, please help
                                                                      Jonathan Fortis Community Member

                                                                      it looks like all the inputs field are getting muddled up.

                                                                      • 32. Re: search results displaying all records, please help
                                                                        Jonathan Fortis Community Member

                                                                        i found the problem, i have another recordset in the main body of the page. the trouble is the other recordset needs to go throughout the site and need to be inbedded into the non editable region. it is only showing results from the DB. When i insert it into the main site it give problems to the pages that already containing infor from the DB

                                                                        • 33. Re: search results displaying all records, please help
                                                                          bregent MVP

                                                                          >Is is a problem ( i know its not good practice) to  have an underscore

                                                                          >or should i go back and start again

                                                                           

                                                                          You can use underscores, proper case, camel case -anything that you want. The key is consistency; it makes your code easier to read which results in less coding errors and easier maintenance. Pick a naming convention for your objects and stick with it 100% of the time. You don't need to use the same convention for database objects as you do for php objects - but within each object type (table name, column name, local variable, etc) be consistent. Search the web for 'database naming conventions' and 'php naming conventions' for some ideas.

                                                                          • 34. Re: search results displaying all records, please help
                                                                            Jonathan Fortis Community Member

                                                                            i will read this and try and keep the coding neat

                                                                            • 35. Re: search results displaying all records, please help
                                                                              Jonathan Fortis Community Member

                                                                              Hello, i am testing the search code

                                                                               

                                                                              $var_SalaryReq_Recordset1 = "xxxxx";

                                                                              if (isset($_GET['SalaryReq'])) {

                                                                                $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];

                                                                              }

                                                                              $var_skills_offered_Recordset1 = "xxxxx";

                                                                              if (isset($_GET['skills_offered'])) {

                                                                                $var_skills_offered_Recordset1 = $_GET['skills_offered'];

                                                                              }

                                                                              $var_location_Recordset1 = "xxxxx";

                                                                              if (isset($_GET['location'])) {

                                                                                $var_location_Recordset1 = $_GET['location'];

                                                                              }

                                                                              $var_PositionReq_Recordset1 = "xxxxx";

                                                                              if (isset($_GET['PositionReq'])) {

                                                                                $var_PositionReq_Recordset1 = $_GET['PositionReq'];

                                                                              }

                                                                              mysql_select_db($database_hostprop, $hostprop);

                                                                              $query_Recordset1 = sprintf("SELECT userid, FirstName, Surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1, "text"));

                                                                              $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);

                                                                              $Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());

                                                                              $row_Recordset1 = mysql_fetch_assoc($Recordset1);

                                                                               

                                                                               

                                                                              in the database i have in the skills_offered column

                                                                               

                                                                              good communicator excellent negotiator truck driver

                                                                               

                                                                              when i search good communicator i get nothing, when i search excellent negotiator i get nothing, when i search truck driver i get tthe result. i have tried various combinations like good driver and i get nothing

                                                                               

                                                                              can anyone help?

                                                                              • 36. Re: search results displaying all records, please help
                                                                                bregent MVP

                                                                                I've already told you where the problem is. If you echo $query_Recordset1 you'll immediately be able to see the cause.

                                                                                • 37. Re: search results displaying all records, please help
                                                                                  Jonathan Fortis Community Member

                                                                                  sorry,,,just needed a kick  . "%"

                                                                                   

                                                                                  thanks for the prompt.

                                                                                   

                                                                                  regards