Jump to content

form problem


Recommended Posts

ok for some reason the form is not querying all the variables....just the first field club..... here is the code:ex of the form at http://www.nightspotz.com/testsearch.php DW is easier for me right now im in the process of learning PHP with MySQL more SORRY forgive me......

 

<?php require_once('../Connections/connNightspotz.php'); ?>

<?php

$currentPage = $_SERVER["PHP_SELF"];

 

$maxRows_rsSRCH = 10;

$pageNum_rsSRCH = 0;

if (isset($_GET['pageNum_rsSRCH'])) {

$pageNum_rsSRCH = $_GET['pageNum_rsSRCH'];

}

$startRow_rsSRCH = $pageNum_rsSRCH * $maxRows_rsSRCH;

 

$AC_rsSRCH = "1";

if (isset($_POST['areacode'])) {

$AC_rsSRCH = (get_magic_quotes_gpc()) ? $_POST['areacode'] : addslashes($_POST['areacode']);

}

$VN_rsSRCH = "2";

if (isset($_POST['venuename'])) {

$VN_rsSRCH = (get_magic_quotes_gpc()) ? $_POST['venuename'] : addslashes($_POST['venuename']);

}

$VT_rsSRCH = "3";

if (isset($_POST['venuetype'])) {

$VT_rsSRCH = (get_magic_quotes_gpc()) ? $_POST['venuetype'] : addslashes($_POST['venuetype']);

}

$AG_rsSRCH = "4";

if (isset($_POST['agegroup'])) {

$AG_rsSRCH = (get_magic_quotes_gpc()) ? $_POST['agegroup'] : addslashes($_POST['agegroup']);

}

$MT_rsSRCH = "5";

if (isset($_POST['musictype'])) {

$MT_rsSRCH = (get_magic_quotes_gpc()) ? $_POST['musictype'] : addslashes($_POST['musictype']);

}

mysql_select_db($database_connNightspotz, $connNightspotz);

$query_rsSRCH = sprintf("SELECT * FROM venues WHERE venuename LIKE '%s%%' OR areacode = '%s' OR venuetype = '%s' OR agegroup = '%s' OR musictype = '%s' ORDER BY venuename DESC", $VN_rsSRCH,$AC_rsSRCH,$VT_rsSRCH,$AG_rsSRCH,$MT_rs

SRCH);

$query_limit_rsSRCH = sprintf("%s LIMIT %d, %d", $query_rsSRCH, $startRow_rsSRCH, $maxRows_rsSRCH);

$rsSRCH = mysql_query($query_limit_rsSRCH, $connNightspotz) or die(mysql_error());

$row_rsSRCH = mysql_fetch_assoc($rsSRCH);

 

if (isset($_GET['totalRows_rsSRCH'])) {

$totalRows_rsSRCH = $_GET['totalRows_rsSRCH'];

} else {

$all_rsSRCH = mysql_query($query_rsSRCH);

$totalRows_rsSRCH = mysql_num_rows($all_rsSRCH);

}

$totalPages_rsSRCH = ceil($totalRows_rsSRCH/$maxRows_rsSRCH)-1;

 

$queryString_rsSRCH = "";

if (!empty($_SERVER['QUERY_STRING'])) {

$params = explode("&", $_SERVER['QUERY_STRING']);

$newParams = array();

foreach ($params as $param) {

if (stristr($param, "pageNum_rsSRCH") == false &&

stristr($param, "totalRows_rsSRCH") == false) {

array_push($newParams, $param);

}

}

if (count($newParams) != 0) {

$queryString_rsSRCH = "&" . htmlentities(implode("&", $newParams));

}

}

$queryString_rsSRCH = sprintf("&totalRows_rsSRCH=%d%s", $totalRows_rsSRCH, $queryString_rsSRCH);

 

$queryString_rsSrch = "";

if (!empty($_SERVER['QUERY_STRING'])) {

$params = explode("&", $_SERVER['QUERY_STRING']);

$newParams = array();

foreach ($params as $param) {

if (stristr($param, "pageNum_rsSrch") == false &&

stristr($param, "totalRows_rsSrch") == false) {

array_push($newParams, $param);

}

}

if (count($newParams) != 0) {

$queryString_rsSrch = "&" . htmlentities(implode("&", $newParams));

}

}

$queryString_rsSrch = sprintf("&totalRows_rsSrch=%d%s", $totalRows_rsSrch, $queryString_rsSrch);

?>

<?php

$query_venues = "DELETE FROM venue";

mysql_query($query_venue,$srch);

?>

 

Link to comment
https://forums.phpfreaks.com/topic/2441-form-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.