Php site search displays no results

Hi I followed this tut, http://www.pixeldigest.com/phpsearch.html
There are 2 pages, the search page with text box and submit button, and the results page. When clicking on the submit button, it takes you to the search result page but no data is displayed :< My database is connected and everything, also when adding the recordset the 'test' works and displays the results.
If some1 could help would be great.
Thanks
Here's the code:
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>search</title>
</head>
<body>
<form id="fmsearch" name="fmsearch" method="get" action="search_result.php">
  <label for="search">search</label>
  <input type="text" name="search" id="search" />
  <label for="submit">submit</label>
  <input type="submit" name="submit" id="submit" value="Submit" />
</form>
</body>
</html>
Result page:
<?php require_once('Connections/search_db.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_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['name'])) {
  $colname_Recordset1 = $_GET['name'];
mysql_select_db($database_search_db, $search_db);
$query_Recordset1 = sprintf("SELECT * FROM resturants WHERE name = %s", GetSQLValueString($colname_Recordset1, "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $search_db) 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;
?>
<!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>search result</title>
</head>
<body>
<?php do { ?>
  <table width="636" border="1" cellspacing="0" cellpadding="0">
    <tr>
      <th height="289" scope="col"><?php echo $row_Recordset1['id']; ?><?php echo $row_Recordset1['name']; ?><br />      <?php echo $row_Recordset1['location']; ?><br /></th>
    </tr>
  </table>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Hi
Change this -
<?php do { ?>
  <table width="636" border="1" cellspacing="0" cellpadding="0">
    <tr>
      <th height="289" scope="col"><?php echo $row_Recordset1['id']; ?><?php echo $row_Recordset1['name']; ?><br />      <?php echo $row_Recordset1['location']; ?><br /></th>
    </tr>
  </table>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
to -
  <table width="636" border="1" cellspacing="0" cellpadding="0">
<?php do { ?>
    <tr>
      <td> <?php echo $row_Recordset1['id']; ?> <br /> <?php echo $row_Recordset1['name']; ?> <br /> <?php echo $row_Recordset1['location']; ?> </td>
    </tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  </table>
PZ

Similar Messages

  • Why does site search return no results?

    I followed the instructions for setting up search at http://helpx.adobe.com/business-catalyst/partner/add-search-form.html. It says the default search will search the entire site, but I got no results. Re-indexed site. Still no results, so I defined a custom search and set it to "Entire Website". Still 0 results for any search. Re-indexed site and waited several hours. Still no results.

    http://drhaddad.businesscatalyst.com/
    The search box form code is
    <form id="search" name="catsearchform25070" method="post" action="/Default.aspx?SiteSearchID=2777&amp;ID=/search-results"><div class="search-box"><input class="cat_textbox_small" type="text" name="CAT_Search" id="CAT_Search" /><input class="cat_button" type="submit" value="Search" /></div></form>
    `/search-results` has `{module_searchresults}`

  • HT201285 What order does spotlight search display??

    I know that this search displays the results by app. But within the app how are the results displayed? For example, if I typed in ok, and all my text messages that have the word ok in them pop up what order are those in if any?
    Also, does anybody konw exactly how long deleted messages will appear in the spotlight search? Or how far back the search goes?

    I can't be certain but they appear to be in reverse chronological order.
    Old messages will appear unti lthe cache gets written over (or is deleted by restoring the phone as new).

  • Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotfo

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

  • RE: Firefox search box - manage search engines - get more search engines.. IT DOESN'T WORK , I now get 1000's of useless irrelevant results, PLEASE FIX THE SITES SEARCH NOW, IT'S COMPLETELY USELESS NOW

    RE: Firefox search box -> manage search engines -> get more search engines..
    IT DOESN'T WORK
    I just want to add youtube + some others to the list of sites in the Firefox search box, I now get 1000's of useless irrelevant results, PLEASE FIX THE SITES SEARCH NOW, IT'S COMPLETELY USELESS NOW

    Hi Kvoter,
    What are you hoping for, firefox to display lists of sites you have visited or bookmarked ?
    *''' it should be able to do that'''
    * my firefox does that
    I am only a fellow ordinary user of Firefox & XP, but maybe the problem is on your machine, rather than needing a fix from firefox. If you take a little time to read this you may be able to sort out the problems yourself.
    I hope you do not mind me covering a few basics:
    * the [[Search bar]] { <-- clickable link -- ] is designed to produce a lot or results, whereas
    *the [[Location bar search|Location Bar]] is a lot more specific and may be [[Location bar autocomplete#w_controlling-behavior|set]] to include or exclude History & or [[bookmarks]]
    If you are getting literally 1000s of totally unrelated results you may need to consider [[Is my Firefox problem a result of malware]]
    Hope to hear that you have solved the problem, or a bit more detail about what still is a problem.
    John

  • How to display the results in order by based on search value

    Hi All,
    how to display the results in the below order.
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    output:
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
    Please let me know is it possible to display the results in that order.
    Regards,
    Rajasekhar

    This may be a bit more accurate:
    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
                  SONGID TITLE
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)

  • How do I get PDFs to appear in the site search results?

    I have read that the BC site seach will show PDF files in its results - http://forums.adobe.com/message/5077569.
    I have added a PDF via the media dowloads and added the litterate to a test page via the module {module_literature,a,}. I then reindexed the site, however when I search for something I do not get any results.
    The site search is set up to search "Entire Website (including Secure Zone)",
    Any ideas why this doesn't work?
    Thanks
    Dean

    Hi Dean
    PM me the site url and few details as how you are trying to search as it should work fine.
    You can create media downloads and then in site search if you use keywords such as download name then it should return the result with links corresponding to media items.
    Sanjit

  • BC site search renders only footer on results page

    BC site search does not show results on search_results.html page.
    It only shows the footer of search_results page - not the whole page.
    see url:
    http://www.pjspeech-hearing.com/FAQ_Page.html
    <!-- search -->
             <div class="search_bar">
       <form name="catsearchform39797" method="post" action="/Default.aspx?SiteSearchID=2796&ID=/search_results.html">
            <fieldset>
            <input type="text" class="search_text" name="CAT_Search" id="CAT_Search" value="Keyword Search" />
            <input type="image" src="images/pixel.gif" class="searchsubmit" />
            </fieldset>
        </form>
        </div>
        <!-- / search-->

    Yes -
    <div class="product_list_block p_detail clearfix">
        <!-- Page Title -->
        <h2>Search Result</h2>
        <div class="clear extra_space"></div>
        <!-- / Page Title -->
        {module_searchresults,12}
        <div class="clear extra_space"></div>

  • ITunes search displays results but isn't clickable?

    When I click on the search bar to search through my library, it displays a drop down of results, but they aren't clickable. I used to be able to click on results (for example an artist or album) and it would take me straight to that result in my library. One day it just stopped working and I'm not sure why.
    If I uncheck the "search entire library" option, it filters my results on the left bar, but doesn't display the results in a drop down anymore, which I liked. If I'm in the "playlists" pane and search for an artist that's not on my current playlist, it just hides all the songs in my current playlist.
    I am using iTunes 11.1.2.32 on Windows 7, but this issue has been persistent through the past couple updates of iTunes (not entirely sure when it started, but definitely in iTunes 11)

    The behavior of the search dropdown has changed (can't recall whether it was iTunes 11 or 12), but the functionality you refer to is still available ... sort of.  With the Search Entire Library function enabled, when you enter a search string it'll show the matching results:
    In this case I searched for "hotten" and got four matching songs.  Clicking on the highlighted bar will show all the matching results in the current view prior to the search - so in this case if I started from Albums view it'll show the three albums that include matches:
    If I start from Songs view (or switch to Songs from the filtered view above) I get:
    Other functions are available by hovering over (not clicking) on the songs shown in the dropdown.  When you do this a "+" appears to the left of the song and an ellipsis ("...") to the right.  Then, clicking on the "+" adds the song to the Up Next list.  Clicking on the ellipsis opens a submenu with other options:
    However, as you rightly point out, this functionality is not available when the Search Entire Library option is disabled.  The bizarre thing here is that when you are viewing a playlist and have Search Entire Library option enabled you get mixed results - the dropdown shows all the matches in your library (whether in the playlist or not), but the top line of the dropdown now says "Show <search name> in <playlist>" and will take you just the matches in the current playlist ... mightily confusing .
    Right now this is probably classified as a "feature", i.e., the omission of the extra options when Search Entire Library option is not selected may be intentional on Apple's part (though who knows why that should be) or could equally well be the result of a bug.  May be worth reporting this at https://www.apple.com/feedback/itunesapp.html.
    BTW, atra1n's suggested solution looks highly dubious.  First. hacking at the registry rarely has the desired effects (or produces unforeseen side effects). Secondly, the registry keys under HKEY_CURRENT_USER\Software\Apple Computer, Inc.\iTunes are related to (or appear to be related to) Outlook integration, Parental Controls, and automatic iDevice syncing - nothing related to search functions.

  • When i search for something it displays the results in babylon search

    my firefox displays the results of babylon which is too slow and in diffrent languages

    Try to change your deafault search provider on settings or download another firefox that is on yahoo so that your results will be viewed on yahoo + yahoo theme.

  • EREC:Search candidates in a requisition displaying blank results

    Hello,
    When i search for candidates within a requisition, its displaying blank results. the results window says Results (46) but i dont see any candidates. The search/Proposed Candidates button has 46 as count as well. In the same pop up window i changed the existing search query and clicked search, even that didn't display any candidates.
    SLG1 has no errors, why is the results number displaying inaccurate data? and then i see all blank rows.....any help is much appreciated.

    Hi Dhana,
    Please check the setting described in wiki topic:
    http://wiki.sdn.sap.com/wiki/display/ERPHCM/Nosearchresultsinaparticularservice
    Regards
    Nicole

  • Using BufferedReader to get Unicode data from a .php site

    Hi,
    Probably a rather mundane question. I'm working on an applet which uses a .php site as a proxy to get at data found in a mySQL database. It's working adequately for text consisting of standard English characters only - the only problem is that every time I read in a file, it starts with the characters ""
    It's not working at all for text using other characters - I get an incomprehensible string of characters in Java when I try that.
    So my assumption is that Java does not understand that my php document is in Unicode, and is trying to read it using a different encoding system. I use unicode charaters elsewhere in this applet and have no problems with them, so I am assumign it must be an I/O error.
    What do I have to do to make Java realize that this is unicode?
    Here's the relevant code as it is now:
    String goTo = "http://[...]/info.php?search=" + toLink(search);
    URL test = new URL(goTo);
    URLConnection testConnection = test.openConnection();
    BufferedReader dis = new BufferedReader(new InputStreamReader(testConnection.getInputStream()));
    String inputLine;
    while ((inputLine = dis.readLine()) != null) {
                    giveout += inputLine;
    dis.close();The String giveout should have all the data from the document in it after this.
    Or do I need to change something about my php, which, as it is now, just displays the data from my database, with no HTML tags whatsoever?

    You probably have a 'byte order marker' ( BOM ) at the beginning of the file. You can use my BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 or you can just discard the BOM bytes from the InputStream before wrapping it in the BufferedReader.
    Hi Sabre im facin the same probem.
    bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
    bufferedReader.readLine() returns a junk character ? at the beginning of the line.
    you have instructed to use your BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 but i dotn know how to use it with bufferedReader because i want my method to return only a BufferedReader object.
    can you suggest me how to go about it.
    my code is as below need help.
    public BufferedReader check(){
                     bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
            return bufferedReader; // need to return bufferedReader object only...since some other code needs bufferedReader ...suggest me.
    i will be highly obliged if you paste the refined code.. please need your urgent help on this...
    Regards
    Deepak

  • How Do I Add A Site Search Box?

    I just upgraded my BC subscription to webMarketing and I am wanting to add a site search box to my site but I am having troubles with the directions found on the Adobe Website: Business Catalyst Help | Add a site search box.
    My first issue is a simple clarification with item #4 under "Create a page to display the search results"
    4. In the editor, enter {module_searchresults} where you want the results to appear on the page.  What exactly is the editor? LOL is that just the Adobe Muse page and I use the text tool and create a box with "{module_searchresults}" in it?
    My next, more critical issue is:
    Add a search box to a template
    Open the template in editing mode by selecting Site Manager > Page Templates, and choosing the template from the list of templates. My BC Admin page has "Site Manager" on the left - but when I click it - it only shows "Web Forms" and "System E-mails" I have no option for "Page Templates". 
    So how do I get "Page Templates" to show up.  I'm pretty sure my "webMarketing" subscription allows for a site search box...maybe I am mistaken.
    Thanks for any help!

    The editor is that of the WYSIWYG editor in the BC admin itself.
    The important thing to know is Muse is NOT BC, it is not the only thing you use to make a BC site, far from it. IT is a really basic tool to build basic sites. The instructions you will find on the BC docs will never reference the way to do it for Muse, just BC, or you can use your own code editor.
    So you need to go login to your website admin and then you will find the pages, templates etc.

  • Adding Site Search in Menu Bar

    Hi there guys, if someone could point me to a tutorial on how to add a site search function to the menu bar (see pic) - that would be awesome...
    I understand I can use a tag to display the results.
    Thanks in advance!!!
    Cheers

    Okay here is what 'I do' ...
    First create a div within your menu bar to old the search form and in your CSS float it right.
    Create the search ..
    Site Manger --> Site Search
    Follow instructions to create the search form and select what you specifically want search.
    Okay creating the search is done
    Now I create a content holder (optional - but I do it that way in case I want to easily add the search elsewhere)
    Open the new Content Holder in the admin (or dreamweaver)
    Click on the Add Modules to page button
    Select Search from the new panel iin the admin or from the BC Panel in DW
    Select Search Form
    Select the search form you want to use
    Click Insert
    This also adds the search results tag as well. Just delete the serach results tag
    Now insert this content holder into the div you created in the nav bar.
    Done.

  • How to make site search module work?

    Hi guys
    I am working on a sample site http://webmar.businesscatalyst.com/index.
    I had insert a site search module but anyhow when i search for any query and click the Go button, it will go the searchresult page but nothing get displayed.
    I do had placed a {module_searchresults} in the page content area of searchresult page.
    How I populate by search result page?
    Thanks
    Andy

    Andy make sure you index (re-index)your site
    Modules > Site Search > Re- Index button
    If site is a sample site ( demo mode ) I am not sure if it will index with new changes to the way demo sites works. Give it a try it may be ok internally, but wont index with S E unless live site
    Good to re-index if made changes or added content

Maybe you are looking for