Forums

PHP

This topic is locked

List Menu multiple fields

Posted 25 Apr 2006 16:58:17
1
has voted
25 Apr 2006 16:58:17 Scott Mason posted:
Can anybody shed some light on this minor problem.

I have a form, one of the fields has a list menu with 20 or so values.

The user can fill out the form and select one or more of the values from that list menu.

My problem is that if the user selects more than one value, only one value gets inputed into the database. How do I get more than one value from the list menu into the database.

I use phpmyadmin to access the database. Is it something to do with the "type" column in the table. At present it is set up as VARCHAR for that field.

If you need to see the site to see what I mean here's the link.

www.scottmason.co.uk/rnrf/main/members/login_database.php

Username - member
password - member

many thanks

Scott

Replies

Replied 25 Apr 2006 17:06:29
25 Apr 2006 17:06:29 Roddy Dairion replied:
use an array, to store all the value selected from that field. Then insert into your table?
I went to your site and which is the field that u can select more than 1 value??
www.scottmason.co.uk/rnrf/main/members/submit_database.php
Replied 25 Apr 2006 17:37:31
25 Apr 2006 17:37:31 Scott Mason replied:
the "Research Topic" field,

I used Dreamweaver Server behaviours for this.
Replied 25 Apr 2006 17:51:22
25 Apr 2006 17:51:22 Roddy Dairion replied:
yeah so like i said use an array, store all the data that has been inserted in there. But something bugs me with wat u said that is u submit the data and only 1 value will be inserted. But if they select lets say 3 values from research field in your form where r they stored in your table???
Replied 25 Apr 2006 17:54:29
25 Apr 2006 17:54:29 Scott Mason replied:
Currently, if a user selects more than one value from the list of "research topics", only the last value gets stored in the database table, I need it so all the values get stored in the database table separated by a comma.

cheers
Replied 25 Apr 2006 18:17:39
25 Apr 2006 18:17:39 Roddy Dairion replied:
in which case use this
your research topic field name in your form which currently look like this
<pre id=code><font face=courier size=2 id=code>&lt;select name="topic" size="1" multiple="multiple" id="topic"&gt;</font id=code></pre id=code>
change it so it looks like this
<pre id=code><font face=courier size=2 id=code>&lt;select name="&lt;?='topic[]'?&gt;" size="1" multiple="multiple" id="topic"&gt;
</font id=code></pre id=code>
Then in your post section put the following
<pre id=code><font face=courier size=2 id=code>
$urvar= $_POST['topic'];
for ($i = 0; $i &lt; count($urvar); $i++)
{
$urvar1.=($urvar1 != "" ? "; " : "". intval($urvar[$i]);

}
</font id=code></pre id=code>
Changes:
where it says
$urvar : change it to the variable of your choice i.e. either the one you're currently using for the post of your research topic field or something else
$urvar1 : this one will be use in the insert of your sql query.

Replied 26 Apr 2006 02:15:46
26 Apr 2006 02:15:46 Scott Mason replied:
thanks Roddy,

where exactly in do i put that piece of code? here is my code at the moment

&lt;?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2") {
$insertSQL = sprintf("INSERT INTO members (first_name, last_name, tel_number, email, newspaper, year, topic, methodology, research_objective) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['first_name'], "text",
GetSQLValueString($_POST['last_name'], "text",
GetSQLValueString($_POST['tel_number'], "text",
GetSQLValueString($_POST['email'], "text",
GetSQLValueString($_POST['newspaper'], "text",
GetSQLValueString($_POST['year'], "text",
GetSQLValueString($_POST['topic'], "text",
GetSQLValueString($_POST['methodology'], "text",
GetSQLValueString($_POST['research_objective'], "text");


mysql_select_db($database_myConnection, $myConnection);
$Result1 = mysql_query($insertSQL, $myConnection) or die(mysql_error());

$insertGoTo = "thank_you.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_myConnection, $myConnection);
$query_submit = "SELECT * FROM members";
$submit = mysql_query($query_submit, $myConnection) or die(mysql_error());
$row_submit = mysql_fetch_assoc($submit);
$totalRows_submit = mysql_num_rows($submit);
?&gt;

cheers

Scott
Replied 26 Apr 2006 11:33:41
26 Apr 2006 11:33:41 Roddy Dairion replied:
Don't forget ur html form topic field shoud be like this
&lt;select name="&lt;?='topic[]'?&gt;" size="1" multiple="multiple" id="topic"&gt;
<pre id=code><font face=courier size=2 id=code>
&lt;?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

$arrtopic= $_POST['topic'];
for ($i = 0; $i &lt; count($arrtopic); $i++)
{
$topic.=($topic != "" ? "; " : "". intval($arrtopic[$i]);

}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2") {
$insertSQL = sprintf("INSERT INTO members (first_name, last_name, tel_number, email, newspaper, year, topic, methodology, research_objective) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['first_name'], "text",
GetSQLValueString($_POST['last_name'], "text",
GetSQLValueString($_POST['tel_number'], "text",
GetSQLValueString($_POST['email'], "text",
GetSQLValueString($_POST['newspaper'], "text",
GetSQLValueString($_POST['year'], "text",
GetSQLValueString($topic, "text",
GetSQLValueString($_POST['methodology'], "text",
GetSQLValueString($_POST['research_objective'], "text");


mysql_select_db($database_myConnection, $myConnection);
$Result1 = mysql_query($insertSQL, $myConnection) or die(mysql_error());

$insertGoTo = "thank_you.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_myConnection, $myConnection);
$query_submit = "SELECT * FROM members";
$submit = mysql_query($query_submit, $myConnection) or die(mysql_error());
$row_submit = mysql_fetch_assoc($submit);
$totalRows_submit = mysql_num_rows($submit);
?&gt;
</font id=code></pre id=code>
Replied 26 Apr 2006 12:21:32
26 Apr 2006 12:21:32 Scott Mason replied:
Hi Roddy,

Thanks for all your help, I really appreciate it.

I copied and pasted the code that you supplied over my code.

now if i select two values in the topic list, it shows up in the database table as:

Array; 0

or if i select three:

Array; 0; 0

What would be be causing this

again thanks for your help
Replied 26 Apr 2006 13:12:30
26 Apr 2006 13:12:30 Roddy Dairion replied:
try this
<pre id=code><font face=courier size=2 id=code>
&lt;?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

$arrtopic= $_POST['topic'];
for ($i = 0; $i &lt; count($arrtopic); $i++)
{
$insert_topic.=($insert_topic != "" ? "; " : "". intval($arrtopic[$i]);

}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2") {
$insertSQL = sprintf("INSERT INTO members (first_name, last_name, tel_number, email, newspaper, year, topic, methodology, research_objective) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['first_name'], "text",
GetSQLValueString($_POST['last_name'], "text",
GetSQLValueString($_POST['tel_number'], "text",
GetSQLValueString($_POST['email'], "text",
GetSQLValueString($_POST['newspaper'], "text",
GetSQLValueString($_POST['year'], "text",
GetSQLValueString($insert_topic, "text",
GetSQLValueString($_POST['methodology'], "text",
GetSQLValueString($_POST['research_objective'], "text");


mysql_select_db($database_myConnection, $myConnection);
$Result1 = mysql_query($insertSQL, $myConnection) or die(mysql_error());

$insertGoTo = "thank_you.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_myConnection, $myConnection);
$query_submit = "SELECT * FROM members";
$submit = mysql_query($query_submit, $myConnection) or die(mysql_error());
$row_submit = mysql_fetch_assoc($submit);
$totalRows_submit = mysql_num_rows($submit);
?&gt;
</font id=code></pre id=code>
Replied 26 Apr 2006 13:23:30
26 Apr 2006 13:23:30 Scott Mason replied:
mmm, now it just shows up in the table as:

0; 0; 0
Replied 26 Apr 2006 14:10:35
26 Apr 2006 14:10:35 Roddy Dairion replied:
I c where the prob is.
On this line
<pre id=code><font face=courier size=2 id=code>$insert_topic.=($insert_topic != "" ? "; " : "". intval($arrtopic[$i]); </font id=code></pre id=code>
remove the intval cause this will take only number.
so this line shoud look like this
<pre id=code><font face=courier size=2 id=code> $insert_topic.=($insert_topic != "" ? "; " : "". ($arrtopic[$i]); </font id=code></pre id=code>
Replied 26 Apr 2006 18:26:50
26 Apr 2006 18:26:50 Scott Mason replied:
Hey Roddy,

Great! thanks a bunch it works, all values are intputed into the table.

But now I have a new problem, when I search using the same criteria, the search results shows no results.

I am still learning about PHP but I am completely lost on this one, can you still help me out.

this is how my current code looks in the search results page


&lt;?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_results = 10;
$pageNum_results = 0;
if (isset($_GET['pageNum_results'])) {
$pageNum_results = $_GET['pageNum_results'];
}
$startRow_results = $pageNum_results * $maxRows_results;

$objective_results = "-1";
if (isset($_GET['research_objective'])) {
$objective_results = (get_magic_quotes_gpc()) ? $_GET['research_objective'] : addslashes($_GET['research_objective']);
}
$year1_results = "ALL";
if (isset($_GET['year'])) {
$year1_results = (get_magic_quotes_gpc()) ? $_GET['year'] : addslashes($_GET['year']);
}
$method_results = "ALL";
if (isset($_GET['methodology'])) {
$method_results = (get_magic_quotes_gpc()) ? $_GET['methodology'] : addslashes($_GET['methodology']);
}
$topic1_results = "-1";
if (isset($_GET['topic'])) {
$topic1_results = (get_magic_quotes_gpc()) ? $_GET['topic'] : addslashes($_GET['topic']);
}
$mail_results = "-1";
if (isset($_GET['email'])) {
$mail_results = (get_magic_quotes_gpc()) ? $_GET['email'] : addslashes($_GET['email']);
}
$news_results = "-1";
if (isset($_GET['newspaper'])) {
$news_results = (get_magic_quotes_gpc()) ? $_GET['newspaper'] : addslashes($_GET['newspaper']);
}
$firstname_results = "-1";
if (isset($_GET['first_name'])) {
$firstname_results = (get_magic_quotes_gpc()) ? $_GET['first_name'] : addslashes($_GET['first_name']);
}
$lastname_results = "-1";
if (isset($_GET['last_name'])) {
$lastname_results = (get_magic_quotes_gpc()) ? $_GET['last_name'] : addslashes($_GET['last_name']);
}
mysql_select_db($database_myConnection, $myConnection);
$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%s' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$topic1_results,$method_results,$objective_results);
$query_limit_results = sprintf("%s LIMIT %d, %d", $query_results, $startRow_results, $maxRows_results);
$results = mysql_query($query_limit_results, $myConnection) or die(mysql_error());
$row_results = mysql_fetch_assoc($results);

if (isset($_GET['totalRows_results'])) {
$totalRows_results = $_GET['totalRows_results'];
} else {
$all_results = mysql_query($query_results);
$totalRows_results = mysql_num_rows($all_results);
}
$totalPages_results = ceil($totalRows_results/$maxRows_results)-1;

$queryString_results = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_results" == false &&
stristr($param, "totalRows_results" == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_results = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_results = sprintf("&totalRows_results=%d%s", $totalRows_results, $queryString_results);
?&gt;


thanks a million
Replied 26 Apr 2006 18:33:17
26 Apr 2006 18:33:17 Roddy Dairion replied:
Wat do u mean search with the same criteria? Which criteria?
Replied 26 Apr 2006 20:41:01
26 Apr 2006 20:41:01 Scott Mason replied:
Ok, heres what happening now.

1. I fill out the submission form selecting 2 values in the topic field

2. The values are intputed into the database table separated by a semicolon

3. Then I search the database using the topics field but I get no results

There are currently 3 entires in the database, Test A, Test B, Test C. Please try for yourslef so you can see what I mean.

thanks again
Replied 27 Apr 2006 13:10:26
27 Apr 2006 13:10:26 Roddy Dairion replied:
Can you send me the whole page with html codes and php. I think that i'll hve to go customer query this.
Replied 27 Apr 2006 13:18:52
27 Apr 2006 13:18:52 Scott Mason replied:
no problem, here is the whole code for the results page: here goes

&lt;?php require_once('../../Connections/myConnection.php'); ?&gt;
&lt;?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "" && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "login_database.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?") $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) &gt; 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?&gt;
&lt;?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_results = 10;
$pageNum_results = 0;
if (isset($_GET['pageNum_results'])) {
$pageNum_results = $_GET['pageNum_results'];
}
$startRow_results = $pageNum_results * $maxRows_results;

$objective_results = "-1";
if (isset($_GET['research_objective'])) {
$objective_results = (get_magic_quotes_gpc()) ? $_GET['research_objective'] : addslashes($_GET['research_objective']);
}
$year1_results = "ALL";
if (isset($_GET['year'])) {
$year1_results = (get_magic_quotes_gpc()) ? $_GET['year'] : addslashes($_GET['year']);
}
$method_results = "ALL";
if (isset($_GET['methodology'])) {
$method_results = (get_magic_quotes_gpc()) ? $_GET['methodology'] : addslashes($_GET['methodology']);
}
$topic1_results = "ALL";
if (isset($_GET['topic'])) {
$topic1_results = (get_magic_quotes_gpc()) ? $_GET['topic'] : addslashes($_GET['topic']);
}
$mail_results = "-1";
if (isset($_GET['email'])) {
$mail_results = (get_magic_quotes_gpc()) ? $_GET['email'] : addslashes($_GET['email']);
}
$news_results = "-1";
if (isset($_GET['newspaper'])) {
$news_results = (get_magic_quotes_gpc()) ? $_GET['newspaper'] : addslashes($_GET['newspaper']);
}
$firstname_results = "-1";
if (isset($_GET['first_name'])) {
$firstname_results = (get_magic_quotes_gpc()) ? $_GET['first_name'] : addslashes($_GET['first_name']);
}
$lastname_results = "-1";
if (isset($_GET['last_name'])) {
$lastname_results = (get_magic_quotes_gpc()) ? $_GET['last_name'] : addslashes($_GET['last_name']);
}
mysql_select_db($database_myConnection, $myConnection);
$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%s' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$topic1_results,$method_results,$objective_results);
$query_limit_results = sprintf("%s LIMIT %d, %d", $query_results, $startRow_results, $maxRows_results);
$results = mysql_query($query_limit_results, $myConnection) or die(mysql_error());
$row_results = mysql_fetch_assoc($results);

if (isset($_GET['totalRows_results'])) {
$totalRows_results = $_GET['totalRows_results'];
} else {
$all_results = mysql_query($query_results);
$totalRows_results = mysql_num_rows($all_results);
}
$totalPages_results = ceil($totalRows_results/$maxRows_results)-1;

$queryString_results = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_results" == false &&
stristr($param, "totalRows_results" == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_results = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_results = sprintf("&totalRows_results=%d%s", $totalRows_results, $queryString_results);
?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;&lt;!-- InstanceBegin template="/Templates/members.dwt" codeOutsideHTMLIsLocked="false" --&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;

&lt;!-- InstanceBeginEditable name="doctitle" --&gt;
&lt;title&gt;RNRF - Research Database&lt;/title&gt;
&lt;!-- InstanceEndEditable --&gt;

&lt;link href="../../css/print.css" rel="stylesheet" type="text/css" /&gt;

&lt;style type="text/css"&gt;@import url(../../css/rnrf.css);&lt;/style&gt;

&lt;!-- InstanceBeginEditable name="head" --&gt;&lt;!-- InstanceEndEditable --&gt;&lt;!-- InstanceParam name="name" type="text" value="database" --&gt;

&lt;script type="text/JavaScript"&gt;
&lt;!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i&lt;(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'";
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body id="database"&gt;

&lt;a name="top" id="top"&gt;&lt;/a&gt;

&lt;!-- START MAIN CONTAINER --&gt;

&lt;div id="outsidewrap"&gt;
&lt;div id="insidewrap" &gt;

&lt;!-- START HEADER --&gt;

&lt;div id="header" &gt;

&lt;div id="logo"&gt;&lt;/div&gt;

&lt;/div&gt;

&lt;!-- END HEADER --&gt;

&lt;!-- START MAIN CONTENT --&gt;

&lt;div id="wrapper" class="clearfix"&gt;

&lt;!-- START CONTENT WRAP --&gt;

&lt;div id="maincontentwrap"&gt;

&lt;!-- START CONTENT --&gt;

&lt;div id="content"&gt;&lt;!-- InstanceBeginEditable name="content" --&gt;
&lt;h1&gt;RNRF - Research Database&lt;/h1&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Members research details&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;?php if ($totalRows_results == 0) { // Show if recordset empty ?&gt;
&lt;p&gt;Sorry, there were no results found&lt;/p&gt;
&lt;?php } // Show if recordset empty ?&gt;
&lt;?php do { ?&gt;
&lt;?php if ($totalRows_results &gt; 0) { // Show if recordset not empty ?&gt;
&lt;table width="80%" border="0" cellpadding="0" cellspacing="0" class="table"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;tr bgcolor="#CCCCCC"&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td width="186"&gt;&nbsp;&lt;/td&gt;
&lt;td width="29"&gt;&nbsp;&lt;/td&gt;
&lt;td width="43"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="172" id="tablestext"&gt;&lt;div align="right"&gt;Name &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['first_name']; ?&gt; &lt;?php echo $row_results['last_name']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Telephone number &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['tel_number']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Email&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['email']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Newspaper / Product title &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['newspaper']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Year of research &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['year']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research topic &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['topic']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research Methodology&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['methodology']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research Objective &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['research_objective']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;?php } // Show if recordset not empty ?&gt;&lt;table width="80%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;?php } while ($row_results = mysql_fetch_assoc($results)); ?&gt;
&lt;p&gt;
&lt;?php if ($pageNum_results &gt; 0) { // Show if not first page ?&gt;
&lt;a href="&lt;?php printf("%s?pageNum_results=%d%s", $currentPage, max(0, $pageNum_results - 1), $queryString_results); ?&gt;"&gt;&lt;&lt; Previous&lt;/a&gt;
&lt;?php } // Show if not first page ?&gt; &lt;?php if ($pageNum_results &lt; $totalPages_results) { // Show if not last page ?&gt;
&lt;a href="&lt;?php printf("%s?pageNum_results=%d%s", $currentPage, min($totalPages_results, $pageNum_results + 1), $queryString_results); ?&gt;"&gt;Next &gt;&gt;&lt;/a&gt;
&lt;?php } // Show if not last page ?&gt;&lt;/p&gt;
&lt;form id="form1" name="form1" method="post" action=""&gt;

&lt;p&gt;&nbsp; &lt;/p&gt;
&lt;p&gt;
&lt;input name="Search again" type="submit" id="Search again" onclick="MM_goToURL('parent','search_database.php');return document.MM_returnValue" value="Search again" /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;!-- InstanceEndEditable --&gt;&lt;/div&gt;

&lt;!-- END CONTENT --&gt;

&lt;/div&gt;

&lt;!-- END CONTENT WRAP --&gt;

&lt;!-- START LEFT COLUMN --&gt;

&lt;div id="leftcol"&gt;

&lt;div id="menu"&gt;
&lt;ul id="navlist"&gt;
&lt;li&gt;&lt;a href="../../index.html" id="nav_index" title="HOME"&gt;HOME&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../about_rnrf.html" id="nav_about" title="ABOUT THE RNRF"&gt;ABOUT THE RNRF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../rnrf_members.html" id="nav_members" title="RNRF MEMBERS"&gt;RNRF MEMBERS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../membership_criteria.html" id="nav_membership" title="MEMBERSHIP CRITERA"&gt;MEMBERSHIP CRITERIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../reports_presentations.html" id="nav_reports" title="REPORTS &amp; PRESENTATIONS"&gt;REPORTS &amp; PRESENTATIONS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../insight_conferences.html" id="nav_conferences" title="INSIGHT CONFERENCES"&gt;INSIGHT CONFERENCES&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="login_database.php" id="nav_database" title="RESEARCH DATABASE"&gt;RESEARCH DATABASE&lt;/a&gt;&lt;/li&gt;

&lt;ul id="navlistdrop"&gt;
&lt;li&gt;&lt;a href="submit_database.php" id="" title="SUBMIT RESEARCH"&gt;SUBMIT RESEARCH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="search_database.php" id="" title="SEARCH DATABASE"&gt;SEARCH DATABASE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="logout.php" id="" title="LOGOUT"&gt;LOGOUT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul id="navlist"&gt;
&lt;li&gt;&lt;a href="../contact_us.html" id="nav_contact" title="CONTACT US"&gt;CONTACT US&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../links.html" id="nav_links" title="LINKS"&gt;LINKS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- END LEFT PANEL --&gt;

&lt;/div&gt;

&lt;!-- END MAIN CONTENT --&gt;

&lt;!-- START FOOTER --&gt;

&lt;div id="validate"&gt;
&lt;a href="validator.w3.org/"&gt;&lt;img src="../../images/comply_xhtml.gif" alt="XHTL Validation" border="0" /&gt;&lt;/a&gt;
&lt;a href="jigsaw.w3.org/css-validator/"&gt;&lt;img src="../../images/comply_css.gif" alt="CSS Validation" border="0" /&gt;&lt;/a&gt;
Designed with accessibility in mind.
&lt;/div&gt;

&lt;div id="footer"&gt;
&lt;p&gt;&lt;a href="#top"&gt;BACK TO TOP&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="../../index.html"&gt;HOME&lt;/a&gt; &loz;
&lt;a href="../about_rnrf.html"&gt;ABOUT THE RNRF&lt;/a&gt; &loz;
&lt;a href="../rnrf_members.html"&gt;RNRF MEMBERS&lt;/a&gt; &loz;
&lt;a href="../membership_criteria.html"&gt;MEMBERSHIP CRITERIA&lt;/a&gt; &loz;
&lt;a href="../reports_presentations/documents/index.php"&gt;REPORTS &amp; PRESENTATIONS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="../rnrf_guidelines.html"&gt;RNRF GUIDLINES&lt;/a&gt; &loz;
&lt;a href="../insight_conferences.html"&gt;INSIGHT CONFERENCES&lt;/a&gt; &loz;
&lt;a href="login_database.php"&gt;RESEARCH DATABASE&lt;/a&gt; &loz;
&lt;a href="../contact_us.html"&gt;CONTACT US&lt;/a&gt; &loz;
&lt;a href="../links.html"&gt;LINKS&lt;/a&gt; &loz; &lt;a href="../../admin/login.php"&gt;ADMIN &lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div id ="copyright"&gt;&copy; RNRF 2006&lt;/div&gt;

&lt;!-- END FOOTER --&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;!-- END MAIN CONTAINER --&gt;

&lt;/body&gt;

&lt;!-- InstanceEnd --&gt;&lt;/html&gt;
&lt;?php
mysql_free_result($results);
?&gt;
&lt;?php require_once('../../Connections/myConnection.php'); ?&gt;
&lt;?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "" && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "login_database.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?") $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) &gt; 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?&gt;
&lt;?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_results = 10;
$pageNum_results = 0;
if (isset($_GET['pageNum_results'])) {
$pageNum_results = $_GET['pageNum_results'];
}
$startRow_results = $pageNum_results * $maxRows_results;

$objective_results = "-1";
if (isset($_GET['research_objective'])) {
$objective_results = (get_magic_quotes_gpc()) ? $_GET['research_objective'] : addslashes($_GET['research_objective']);
}
$year1_results = "ALL";
if (isset($_GET['year'])) {
$year1_results = (get_magic_quotes_gpc()) ? $_GET['year'] : addslashes($_GET['year']);
}
$method_results = "ALL";
if (isset($_GET['methodology'])) {
$method_results = (get_magic_quotes_gpc()) ? $_GET['methodology'] : addslashes($_GET['methodology']);
}
$topic1_results = "ALL";
if (isset($_GET['topic'])) {
$topic1_results = (get_magic_quotes_gpc()) ? $_GET['topic'] : addslashes($_GET['topic']);
}
$mail_results = "-1";
if (isset($_GET['email'])) {
$mail_results = (get_magic_quotes_gpc()) ? $_GET['email'] : addslashes($_GET['email']);
}
$news_results = "-1";
if (isset($_GET['newspaper'])) {
$news_results = (get_magic_quotes_gpc()) ? $_GET['newspaper'] : addslashes($_GET['newspaper']);
}
$firstname_results = "-1";
if (isset($_GET['first_name'])) {
$firstname_results = (get_magic_quotes_gpc()) ? $_GET['first_name'] : addslashes($_GET['first_name']);
}
$lastname_results = "-1";
if (isset($_GET['last_name'])) {
$lastname_results = (get_magic_quotes_gpc()) ? $_GET['last_name'] : addslashes($_GET['last_name']);
}
mysql_select_db($database_myConnection, $myConnection);
$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%s' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$topic1_results,$method_results,$objective_results);
$query_limit_results = sprintf("%s LIMIT %d, %d", $query_results, $startRow_results, $maxRows_results);
$results = mysql_query($query_limit_results, $myConnection) or die(mysql_error());
$row_results = mysql_fetch_assoc($results);

if (isset($_GET['totalRows_results'])) {
$totalRows_results = $_GET['totalRows_results'];
} else {
$all_results = mysql_query($query_results);
$totalRows_results = mysql_num_rows($all_results);
}
$totalPages_results = ceil($totalRows_results/$maxRows_results)-1;

$queryString_results = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_results" == false &&
stristr($param, "totalRows_results" == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_results = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_results = sprintf("&totalRows_results=%d%s", $totalRows_results, $queryString_results);
?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;&lt;!-- InstanceBegin template="/Templates/members.dwt" codeOutsideHTMLIsLocked="false" --&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;

&lt;!-- InstanceBeginEditable name="doctitle" --&gt;
&lt;title&gt;RNRF - Research Database&lt;/title&gt;
&lt;!-- InstanceEndEditable --&gt;

&lt;link href="../../css/print.css" rel="stylesheet" type="text/css" /&gt;

&lt;style type="text/css"&gt;@import url(../../css/rnrf.css);&lt;/style&gt;

&lt;!-- InstanceBeginEditable name="head" --&gt;&lt;!-- InstanceEndEditable --&gt;&lt;!-- InstanceParam name="name" type="text" value="database" --&gt;

&lt;script type="text/JavaScript"&gt;
&lt;!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i&lt;(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'";
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body id="database"&gt;

&lt;a name="top" id="top"&gt;&lt;/a&gt;

&lt;!-- START MAIN CONTAINER --&gt;

&lt;div id="outsidewrap"&gt;
&lt;div id="insidewrap" &gt;

&lt;!-- START HEADER --&gt;

&lt;div id="header" &gt;

&lt;div id="logo"&gt;&lt;/div&gt;

&lt;/div&gt;

&lt;!-- END HEADER --&gt;

&lt;!-- START MAIN CONTENT --&gt;

&lt;div id="wrapper" class="clearfix"&gt;

&lt;!-- START CONTENT WRAP --&gt;

&lt;div id="maincontentwrap"&gt;

&lt;!-- START CONTENT --&gt;

&lt;div id="content"&gt;&lt;!-- InstanceBeginEditable name="content" --&gt;
&lt;h1&gt;RNRF - Research Database&lt;/h1&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Members research details&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;?php if ($totalRows_results == 0) { // Show if recordset empty ?&gt;
&lt;p&gt;Sorry, there were no results found&lt;/p&gt;
&lt;?php } // Show if recordset empty ?&gt;
&lt;?php do { ?&gt;
&lt;?php if ($totalRows_results &gt; 0) { // Show if recordset not empty ?&gt;
&lt;table width="80%" border="0" cellpadding="0" cellspacing="0" class="table"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;tr bgcolor="#CCCCCC"&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td width="186"&gt;&nbsp;&lt;/td&gt;
&lt;td width="29"&gt;&nbsp;&lt;/td&gt;
&lt;td width="43"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="172" id="tablestext"&gt;&lt;div align="right"&gt;Name &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['first_name']; ?&gt; &lt;?php echo $row_results['last_name']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Telephone number &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['tel_number']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Email&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['email']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Newspaper / Product title &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['newspaper']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Year of research &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['year']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research topic &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['topic']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research Methodology&lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['methodology']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="tablestext"&gt;&lt;div align="right"&gt;Research Objective &lt;/div&gt;&lt;/td&gt;
&lt;td colspan="3" id="tablestext"&gt;&lt;?php echo $row_results['research_objective']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;?php } // Show if recordset not empty ?&gt;&lt;table width="80%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;?php } while ($row_results = mysql_fetch_assoc($results)); ?&gt;
&lt;p&gt;
&lt;?php if ($pageNum_results &gt; 0) { // Show if not first page ?&gt;
&lt;a href="&lt;?php printf("%s?pageNum_results=%d%s", $currentPage, max(0, $pageNum_results - 1), $queryString_results); ?&gt;"&gt;&lt;&lt; Previous&lt;/a&gt;
&lt;?php } // Show if not first page ?&gt; &lt;?php if ($pageNum_results &lt; $totalPages_results) { // Show if not last page ?&gt;
&lt;a href="&lt;?php printf("%s?pageNum_results=%d%s", $currentPage, min($totalPages_results, $pageNum_results + 1), $queryString_results); ?&gt;"&gt;Next &gt;&gt;&lt;/a&gt;
&lt;?php } // Show if not last page ?&gt;&lt;/p&gt;
&lt;form id="form1" name="form1" method="post" action=""&gt;

&lt;p&gt;&nbsp; &lt;/p&gt;
&lt;p&gt;
&lt;input name="Search again" type="submit" id="Search again" onclick="MM_goToURL('parent','search_database.php');return document.MM_returnValue" value="Search again" /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;!-- InstanceEndEditable --&gt;&lt;/div&gt;

&lt;!-- END CONTENT --&gt;

&lt;/div&gt;

&lt;!-- END CONTENT WRAP --&gt;

&lt;!-- START LEFT COLUMN --&gt;

&lt;div id="leftcol"&gt;

&lt;div id="menu"&gt;
&lt;ul id="navlist"&gt;
&lt;li&gt;&lt;a href="../../index.html" id="nav_index" title="HOME"&gt;HOME&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../about_rnrf.html" id="nav_about" title="ABOUT THE RNRF"&gt;ABOUT THE RNRF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../rnrf_members.html" id="nav_members" title="RNRF MEMBERS"&gt;RNRF MEMBERS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../membership_criteria.html" id="nav_membership" title="MEMBERSHIP CRITERA"&gt;MEMBERSHIP CRITERIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../reports_presentations.html" id="nav_reports" title="REPORTS &amp; PRESENTATIONS"&gt;REPORTS &amp; PRESENTATIONS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../insight_conferences.html" id="nav_conferences" title="INSIGHT CONFERENCES"&gt;INSIGHT CONFERENCES&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="login_database.php" id="nav_database" title="RESEARCH DATABASE"&gt;RESEARCH DATABASE&lt;/a&gt;&lt;/li&gt;

&lt;ul id="navlistdrop"&gt;
&lt;li&gt;&lt;a href="submit_database.php" id="" title="SUBMIT RESEARCH"&gt;SUBMIT RESEARCH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="search_database.php" id="" title="SEARCH DATABASE"&gt;SEARCH DATABASE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="logout.php" id="" title="LOGOUT"&gt;LOGOUT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul id="navlist"&gt;
&lt;li&gt;&lt;a href="../contact_us.html" id="nav_contact" title="CONTACT US"&gt;CONTACT US&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../links.html" id="nav_links" title="LINKS"&gt;LINKS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- END LEFT PANEL --&gt;

&lt;/div&gt;

&lt;!-- END MAIN CONTENT --&gt;

&lt;!-- START FOOTER --&gt;

&lt;div id="validate"&gt;
&lt;a href="validator.w3.org/"&gt;&lt;img src="../../images/comply_xhtml.gif" alt="XHTL Validation" border="0" /&gt;&lt;/a&gt;
&lt;a href="jigsaw.w3.org/css-validator/"&gt;&lt;img src="../../images/comply_css.gif" alt="CSS Validation" border="0" /&gt;&lt;/a&gt;
Designed with accessibility in mind.
&lt;/div&gt;

&lt;div id="footer"&gt;
&lt;p&gt;&lt;a href="#top"&gt;BACK TO TOP&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="../../index.html"&gt;HOME&lt;/a&gt; &loz;
&lt;a href="../about_rnrf.html"&gt;ABOUT THE RNRF&lt;/a&gt; &loz;
&lt;a href="../rnrf_members.html"&gt;RNRF MEMBERS&lt;/a&gt; &loz;
&lt;a href="../membership_criteria.html"&gt;MEMBERSHIP CRITERIA&lt;/a&gt; &loz;
&lt;a href="../reports_presentations/documents/index.php"&gt;REPORTS &amp; PRESENTATIONS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="../rnrf_guidelines.html"&gt;RNRF GUIDLINES&lt;/a&gt; &loz;
&lt;a href="../insight_conferences.html"&gt;INSIGHT CONFERENCES&lt;/a&gt; &loz;
&lt;a href="login_database.php"&gt;RESEARCH DATABASE&lt;/a&gt; &loz;
&lt;a href="../contact_us.html"&gt;CONTACT US&lt;/a&gt; &loz;
&lt;a href="../links.html"&gt;LINKS&lt;/a&gt; &loz; &lt;a href="../../admin/login.php"&gt;ADMIN &lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div id ="copyright"&gt;&copy; RNRF 2006&lt;/div&gt;

&lt;!-- END FOOTER --&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;!-- END MAIN CONTAINER --&gt;

&lt;/body&gt;

&lt;!-- InstanceEnd --&gt;&lt;/html&gt;
&lt;?php
mysql_free_result($results);
?&gt;
Replied 27 Apr 2006 13:54:52
27 Apr 2006 13:54:52 Roddy Dairion replied:
Y r u using $_GET to search ur database won't it be easier for u to use $_POST instead?
Replied 27 Apr 2006 14:03:02
27 Apr 2006 14:03:02 Roddy Dairion replied:
Can you change your current query to this please:
<pre id=code><font face=courier size=2 id=code>
$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%$topic1_results%' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$method_results,$objective_results);
</font id=code></pre id=code>
Replied 27 Apr 2006 14:27:42
27 Apr 2006 14:27:42 Scott Mason replied:
I changed the query to as you suggested, when i performed a search i got the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 1

Do i need to change all $_GET to $_POST
Replied 27 Apr 2006 14:48:01
27 Apr 2006 14:48:01 Roddy Dairion replied:
Try this one
<pre id=code><font face=courier size=2 id=code>$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%s%' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$topic1_results,$method_results,$objective_results); </font id=code></pre id=code>
Replied 27 Apr 2006 15:01:23
27 Apr 2006 15:01:23 Scott Mason replied:
no, same error message
Replied 27 Apr 2006 15:02:40
27 Apr 2006 15:02:40 Scott Mason replied:
bye the way, thanks for all your efforts <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 27 Apr 2006 15:04:07
27 Apr 2006 15:04:07 Roddy Dairion replied:
if this doesn't work den i'll hve to custom code it completely.
<pre id=code><font face=courier size=2 id=code>
$query_results = sprintf("SELECT * FROM members WHERE first_name LIKE '%s' OR last_name LIKE '%s' OR email LIKE '%s' OR newspaper LIKE '%s' OR year = '%s' OR topic LIKE '%%s%' OR methodology LIKE '%s' OR research_objective LIKE '%s'", $firstname_results,$lastname_results,$mail_results,$news_results,$year1_results,$topic1_results,$method_results,$objective_results);
</font id=code></pre id=code>
Replied 27 Apr 2006 15:15:07
27 Apr 2006 15:15:07 Scott Mason replied:
no, i get his error this time

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select-' OR research_objective LIKE '-1' LIMIT 0, 10' at line 1
Replied 27 Apr 2006 15:28:20
27 Apr 2006 15:28:20 Roddy Dairion replied:
Lets cheat try out.
Replace matching codes with this:
<pre id=code><font face=courier size=2 id=code>
$topic1_results = "ALL";
if (isset($_GET['topic'])) {
$topic1_results = (get_magic_quotes_gpc()) ? ."%".$_GET['topic']."%". : ."%".addslashes($_GET['topic'])."%";
}
</font id=code></pre id=code>

Reply to this topic