Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/nightsp/public_html/testcode.php on line 38
Sorry, No Records Were Found!
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home2/nightsp/public_html/testcode.php on line 46
and here is the code can you read the notes i put in please thanks, i greatly appreciate this:
by the way $AG = $_POST[agegroup], $VT = $_POST[venuetype]
$MT = $_POST[musictype]; are list boxes as u can see on the page nightspotz.com
Code: Select all
<?php
$VN = $_POST[venuename];
$AC = $_POST[areacode];
$AG = $_POST[agegroup];
//-----HOW DO I ADD THESE TO VARIBLES TO THE QUERY FROM MY SEARCH FORM---------
$VT = $_POST[venuetype];
$MT = $_POST[musictype];
//-----------------------------------------------------
$HostID = $_POST[localhost];
$UserID = $_POST[*******];
$PassID = $_POST[*******];
$dbname = $_POST[********];
$Table = $_POST[venues];
//----------CAN I TAKE THIS TABLE OUT OR WAS THIS JUST TO ECHO AND SEE IF IT WORKS..I DONT NEED ANY OF
//---THESE TABLES I'LL FORMAT IT IN DREAMWEAVER BUT CAN U SHOW ME HOW TO JUST GET THE RESULTS WITH THE
//----PHP ICON SO I CAN JUST POSITION THEM IN DREAMWEAVER...THANKS...
echo "<TABLE BORDER=1 align=center>";
echo "<TD>First Name</TD><TD>Last Name</TD><TD>Street Address</TD><TD>City</TD><TD>State</TD><TR>";
echo "<td>".$VN."</td><td>".$AC."</td><td>".$AG."</td>";
echo "<td>".$City."</td><td>".$State."</td>";
echo "</TR></table><p>";
//---------------------------------------------------------------------------------------------
mysql_select_db ($dbname);
$mysql_mylink = mysql_pconnect($HostID, $UserID, $PassID);
echo "<TABLE class='sortable' id='Identify' BORDER=1 align=center>";
echo "<TD>VENUENAME</TD><TD>AREACODE</TD><TD>Street Address</TD><TD>city</TD><TD>state</TD>";
$querystring = "select * from '$Table'";
if ($VN != "" && $AC != "" && $AG != "") {$querystring = $guerystring + "where (venuename like '%$VN%') and (areacode like '%$AC%') and (agegroup like '%$AG%')";}
if ($VN != "" && $AC != "" && $AG == "") {$querystring = $guerystring + "where (venuename like '%$VN%') and (areacode like '%$AC%')";}
if ($VN != "" && $AC == "" && $AG == "") {$querystring = $guerystring + "where (venuename like '%$VN%')";}
if ($VN != "" && $AC == "" && $AG != "") {$querystring = $guerystring + "where (venuename like '%$VN%') and (agegroup like '%$AG%')";}
$SearchMatch = mysql_query ($querystring);
if ($MatchRecordRow = mysql_fetch_array($SearchMatch)) {
do{
echo "<TR><td>".$MatchRecordRow['venuename']."</TD>";
echo "<td>".$MatchRecordRow['areacode']."</TD><td>".$MatchRecordRow['agegroup']."</TD>";
echo "<td>".$MatchRecordRow['city']."</TD><td>".$MatchRecordRow['state']."</TD>";
} while($MatchRecordRow = mysql_fetch_array($SearchMatch));
} else {echo "<center>Sorry, No Records Were Found!</center>";}
echo "</table>";
mysql_free_result($SearchMatch);
?>