New problem
Ok so ive sorted that connection problem out and this is where ive got to and what i want to achieve.
The website is a funeral directors and i need to create a donations page with a search box so that donors can enter the deceased name and as a result a name (or names similar to what has been entered) will appear. Next to the name will be a URL. Each deceased person(s) will have a unique URL, donation payments wont actually be taken on this website, the URL will link them to a different donations page for that individual on another website, the link will redirect them to that website (hopefully all that makes sense!).
Ive setup MAMP on my computer, created a table for database information in phpmyadmin, connected deamweaver to that database with a recordset, created a DataAssist Search Wizard php page which automatically inserts the form on my donations.html page (please see attached donations.html and ive pasted search.php below)
But i am now stuck as to what to do next. Will the results appear on this page or do i need to create a html page for results to appear on and a new php page for results? I am confused as to what i need to do?
Any help REALLY appreciated!!
<?php require_once('Connections/milesdata.php'); ?>
<?php require_once("webassist/database_management/wada_search.php"); ?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: milesdata;
//Searchpage: donations.html;
//Form: form1;
$WADbSearch2_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch2"])) && ($_POST["WADbSearch2"] != "")) {
$WADbSearch2 = new FilterDef;
$WADbSearch2->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr0 = array("name");
//comparison list additions
$WADbSearch2->keywordComparison($KeyArr0,"".((isset($_POST["Name"]))? $_POST["Name"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch2_search"]=$WADbSearch2->whereClause;
}
}
else {
$WADbSearch2 = new FilterDef;
$WADbSearch2->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch2_search"]) && $_SESSION["WADbSearch2_search"] != "") {
$WADbSearch2->whereClause = $_SESSION["WADbSearch2_search"];
}
else {
$WADbSearch2->whereClause = $WADbSearch2_DefaultWhere;
}
}
else {
$WADbSearch2->whereClause = $WADbSearch2_DefaultWhere;
}
}
$WADbSearch2->whereClause = str_replace("\\''", "''", $WADbSearch2->whereClause);
$WADbSearch2whereClause = '';
?>
<?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_milesdata, $milesdata);
$query_milesdata = "SELECT url FROM donation WHERE name = 'name' ORDER BY name ASC";
setQueryBuilderSource($query_milesdata,$WADbSearch2,false);
$milesdata = mysql_query($query_milesdata, $milesdata) or die(mysql_error());
$row_milesdata = mysql_fetch_assoc($milesdata);
$totalRows_milesdata = mysql_num_rows($milesdata);
?>
<?php
mysql_free_result($milesdata);
?>