Thanks for your help on this, im using an application called webassist to aid me with creating php pages. If im just getting info from 1 table the above querystring works, but i have INNER JOINED 2 tables (petdata AND customerdata) using the 'id' from both tables. After doing this its not working, im using the webassist application as im very new to php code. thanks for your help, below is the complete code from my Results page and im trying too pass on the 'id' value to my details page.
<?php require_once('Connections/petsCon.php'); ?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: ResultsRS;
//Searchpage: Index.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
$KeyArr1 = array("breed");
$KeyArr2 = array("price");
$KeyArr3 = array("city");
//comparison list additions
$WADbSearch1->addComparisonFromList("type","TypeSearch","AND","=",0);
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($POST["breedSearch"]))?$POST["breedSearch"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr2,"".((isset($POST["priceSearch"]))?$POST["priceSearch"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
$WADbSearch1->addComparisonFromList("country","countrySearch","AND","=",0);
$WADbSearch1->keywordComparison($KeyArr3,"".((isset($POST["citySearch"]))?$POST["citySearch"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
//save the query in a session variable
if (1 == 1) {
$SESSION["WADbSearch1_ResultsPet"]=$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_ResultsPet"]) && $SESSION["WADbSearch1_ResultsPet"] != "") {
$WADbSearch1->whereClause = $SESSION["WADbSearch1_ResultsPet"];
}
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;
}
}
$maxRows_ResultsRS = 10;
$pageNum_ResultsRS = 0;
if (isset($GET['pageNum_ResultsRS'])) {
$pageNum_ResultsRS = $GET['pageNum_ResultsRS'];
}
$startRow_ResultsRS = $pageNum_ResultsRS * $maxRows_ResultsRS;
mysql_select_db($database_petsCon, $petsCon);
$query_ResultsRS = "SELECT * FROM petdata INNER JOIN customerdata ON (petdata.id = customerdata.id)";
setQueryBuilderSource($query_ResultsRS,$WADbSearch1,false);
$query_limit_ResultsRS = sprintf("%s LIMIT %d, %d", $query_ResultsRS, $startRow_ResultsRS, $maxRows_ResultsRS);
$ResultsRS = mysql_query($query_limit_ResultsRS, $petsCon) or die(mysql_error());
$row_ResultsRS = mysql_fetch_assoc($ResultsRS);
if (isset($GET['totalRows_ResultsRS'])) {
$totalRows_ResultsRS = $GET['totalRows_ResultsRS'];
} else {
$all_ResultsRS = mysql_query($query_ResultsRS);
$totalRows_ResultsRS = mysql_num_rows($all_ResultsRS);
}
$totalPages_ResultsRS = ceil($totalRows_ResultsRS/$maxRows_ResultsRS)-1;
?>