another search
How about this one, simple search with the search wizard?
I must be doing something wrong.
any help?
<?php require_once('Connections/connNids.php'); ?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: emailtest;
//Searchpage: emailtest.php;
//Form: form1;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromEdit("received","From","AND",">=",2);
$WADbSearch1->addComparison("received","".WAQB_getEndDate($_POST["To"]) ."","AND","<=",2);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_emailtest"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_emailtest"]) && $_SESSION["WADbSearch1_emailtest"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_emailtest"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
<?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;
}
}
mysql_select_db($database_connNids, $connNids);
$query_emailtest = "SELECT message FROM message";
setQueryBuilderSource($query_emailtest,$WADbSearch1,false);
$emailtest = mysql_query($query_emailtest, $connNids) or die(mysql_error());
$row_emailtest = mysql_fetch_assoc($emailtest);
$totalRows_emailtest = mysql_num_rows($emailtest);
?>
<!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>
<link href="mystyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" name="form1" method="post" action="emailtest.php">
<label>From:
<input type="text" name="From" id="From" />
</label>
<label>Submit
<input type="submit" name="Submit" id="Submit" value="Submit" />
</label>
<label>To:
<input type="text" name="To" id="To" />
</label>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="center"><input type="hidden" name="WADbSearch1" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($emailtest);
?>