1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with search

Discussion in 'PHP' started by RadioBounce, Dec 19, 2010.

  1. #1
    Hey guys, I recently installed a new script called eDirectory and I'm having some problems with the search.

    Basically, if for example I search for 'McDonalds', the results show and all the McDonalds show up however I also get an error message saying:

    Database Error. System Administrator has been notified and this problem will be solved as soon as possible. We are sorry for the inconvenience.
    Code (markup):
    and an email saying:

    BTW, the error above was for a search for Sylhet Motors Inc.

    Now, I don't just want to disable these errors, I want to fix them however I have little to no knowledge in PHP, any help? :) Thanks.
     
    RadioBounce, Dec 19, 2010 IP
  2. mweldan

    mweldan Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can you show results.php?

    EDITED:

    the database is not mysql?
     
    Last edited: Dec 19, 2010
    mweldan, Dec 19, 2010 IP
  3. mweldan

    mweldan Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i did some searching and still confused.

    the column name is: fulltextsearch_keyword ?

    fulltext searching can be simple as:

    
    select * from Event 
    where status='A' 
    and end_date >= DATE_FORMAT(NOW(), '%Y-%m-%d')
    and match(column_name_for_places) againts('keyword entered by user..')
    order by id
    
    Code (markup):
    http://devzone.zend.com/article/1304
     
    Last edited: Dec 19, 2010
    mweldan, Dec 19, 2010 IP
  4. RadioBounce

    RadioBounce Banned

    Messages:
    4,171
    Likes Received:
    16
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Hello, as I said before, I'm inexperienced in PHP but here is the contents of results.php:

    <?
    
    	/*==================================================================*\
    	######################################################################
    	#                                                                    #
    	# SisDir Class- System of Class Online 2009           #
    	#                                                                    #
    	#                #
    	#                       #
    	#                                                                    #
    	# ---------------- 2009 - this file is used in php. ----------------- #
    	#                                                                    #
    	# http://wxw.google.cn / wxw.msn.cn #
    	######################################################################
    	\*==================================================================*/
    
    	# ----------------------------------------------------------------------------------------------------
    	# * FILE: /results.php
    	# ----------------------------------------------------------------------------------------------------
    
    	# ----------------------------------------------------------------------------------------------------
    	# LOAD CONFIG
    	# ----------------------------------------------------------------------------------------------------
    	include("./conf/loadconfig.inc.php");
    
    	# ----------------------------------------------------------------------------------------------------
    	# VALIDATION
    	# ----------------------------------------------------------------------------------------------------
    	include(EDIRECTORY_ROOT."/includes/code/validate_querystring.php");
    	include(EDIRECTORY_ROOT."/includes/code/validate_frontrequest.php");
    
    	# ----------------------------------------------------------------------------------------------------
    	# SITE CONTENT
    	# ----------------------------------------------------------------------------------------------------
    	$contentObj = new Content("", EDIR_LANGUAGE);
    	$sitecontentSection = "Directory Results";
    	$sitecontentinfo = $contentObj->retrieveContentInfoByType($sitecontentSection);
    	if ($sitecontentinfo) {
    		$headertagtitle = $sitecontentinfo["title"];
    		$headertagdescription = $sitecontentinfo["description"];
    		$headertagkeywords = $sitecontentinfo["keywords"];
    		$sitecontent = $sitecontentinfo["content"];
    	} else {
    		$headertagtitle = "";
    		$headertagdescription = "";
    		$headertagkeywords = "";
    		$sitecontent = "";
    	}
    
    	# ----------------------------------------------------------------------------------------------------
    	# RESULTS
    	# ----------------------------------------------------------------------------------------------------
    
    	$search_lock = false;
    	if (LISTING_SCALABILITY_OPTIMIZATION == "on") {
    		if (!$_GET["keyword"] && !$_GET["where"] && !$_GET["category_id"] && !$_GET["state_id"] && !$_GET["zip"] && !$_GET["template_id"] && !$_GET["id"]) {
    			$_GET["id"] = 0;
    			$search_lock = true;
    		}
    	}
    
    	unset($searchReturn);
    	$searchReturn = search_frontListingSearch($_GET, "listing");
    	$pageObj = new pageBrowsing($searchReturn["from_tables"], $screen, 10, $searchReturn["order_by"], "Listing.title", $letter, $searchReturn["where_clause"], $searchReturn["select_columns"], "Listing", $searchReturn["group_by"]);
    	$listings = $pageObj->retrievePage();
    
    	$paging_url = DEFAULT_URL."/results.php";
    
    	$array_search_params = array();
    	foreach ($_GET as $name => $value){
    		if ($name != "screen" && $name != "letter"){
    			$array_search_params[] = $name."=".$value;
    		}
    	}
    	$url_search_params = implode("&amp;", $array_search_params);
        
    	$letters = $pageObj->getString("letters");
    	foreach ($letters as $each_letter) {
    		if ($each_letter == "#") {
    			$letters_menu .= "<a href=\"$paging_url?letter=no".(($url_search_params) ? "&amp;$url_search_params" : "")."\" ".(($letter == "no") ? "class=\"firstLetter\" style=\"color:#EF413D\"" : "" ).">".strtoupper($each_letter)."</a>";
    		} else {
    			$letters_menu .= "<a href=\"$paging_url?letter=".$each_letter.(($url_search_params) ? "&amp;$url_search_params" : "")."\" ".(($each_letter == $letter) ? "style=\"color:#EF413D\"" : "" ).">".strtoupper($each_letter)."</a>";
    		}
    	}
    
    	$user = true;
    
    	# PAGES DROP DOWN ----------------------------------------------------------------------------------------------
    	$pagesDropDown = $pageObj->getPagesDropDown($_GET, $paging_url, $screen, system_showText(LANG_PAGING_GOTOPAGE)." ", "this.form.submit();");
    	# --------------------------------------------------------------------------------------------------------------
    
    	# ----------------------------------------------------------------------------------------------------
    	# HEADER
    	# ----------------------------------------------------------------------------------------------------
    	$extrastyle = DEFAULT_URL."/layout/results.css";
    	$headertag_title = $headertagtitle;
    	$headertag_description = $headertagdescription;
    	$headertag_keywords = $headertagkeywords;
    	include(EDIRECTORY_ROOT."/layout/header.php");
    
    	# ----------------------------------------------------------------------------------------------------
    	# AUX
    	# ----------------------------------------------------------------------------------------------------
    	require(EDIRECTORY_ROOT."/frontend/checkregbin.php");
    
    	# ----------------------------------------------------------------------------------------------------
    	# BODY
    	# ----------------------------------------------------------------------------------------------------
    	if (EDIR_THEME) {
    		include(THEMEFILE_DIR."/".EDIR_THEME."/body/results.php");
    	} else {
    		include(EDIRECTORY_ROOT."/frontend/body/results.php");
    	}
    
    	# ----------------------------------------------------------------------------------------------------
    	# FOOTER
    	# ----------------------------------------------------------------------------------------------------
    	include(EDIRECTORY_ROOT."/layout/footer.php");
    
    ?>
    
    PHP:
     
    RadioBounce, Dec 19, 2010 IP
  5. mweldan

    mweldan Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    check in database whether you have column named 'fulltextsearch_keyword' . if it really there..

    probably that just because there is no record for 'Sylhet Sylhets Motors Motor Inc. Inc.s'

    you can redirect user to 'not found' pages or whatever.
     
    mweldan, Dec 19, 2010 IP