I try to implenant a search module and I can't connect to the DB, may I ask help?
And how may I replace the table prefix?
The code:
Code: Alles auswählen
<?php
include_once ("config.php");
include_once ($contenido_path . "includes/config.php");
include_once ($contenido_path . "includes/startup.php");
cInclude("includes", "functions.con.php");
cInclude("includes", "functions.con2.php");
cInclude("includes", "functions.api.php");
cInclude("includes", "functions.pathresolver.php");
include_once($cfg["path"]["contenido"].$cfg["path"]["includes"]."functions.con.php");
$dbConnect = new DB_Contenido;
//Send some headers to keep the user's browser from caching the response.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-Type: text/xml; charset=utf-8");
///Make sure that a value was sent.
if (isset($_GET['search']) && $_GET['search'] != '') {
//Add slashes to any quotes to avoid SQL problems.
$search = addslashes($_GET['search']);
//Get every page title for the site.
$suggest_query = @mysql_query("SELECT keyword FROM con__keywords WHERE like('%".$search."%') order by keyword limit 15");
while($suggest = db_fetch_array($suggest_query)) {
//Return each page title seperated by a newline.
echo $suggest['suggest'] . "\n";
}
}
?>
Thx a lot ion advance.
Regards, Dominique