Jump to content

messy

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

messy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi - I want my search for members to bring back the URL as a hyperlink - The below code brings the hyperlink it but it adds it to the end of my main URL - so I end up with both my URL and the members in a single string in the browser - Any suggestions? CODE - In my search results page <tr> <td class="lighterleft">Website</td> <td class="lighter"><a href="<?php echo $row_Recordset1['Website']; ?>"><?php echo $row_Recordset1['Website']; ?></a></td> </tr>
  2. I am very new to all of this but maybe someone could put my on the right track - thanks a mill ERROR IN FIREFOX AFTER SEARCH 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 'FROM AllData where 1=1 AND AllData.Restaurant = 1' at line 1 CODE - SEARCH RESULTS PAGE <?php require_once('connections/testing.php'); ?> <?php //search value $searchByCounty = $_POST['county']; $searchByCategory = $_POST['category']; mysql_select_db($database_Testing, $Testing); $query_Recordset1 = "SELECT AllData.Restaurant, AllData.Producer, AllData.Cookery_School, AllData.Caterer, AllData.Consultant, AllData.Accomodation, AllData.Patron, AllData.Freelance, AllData.Lecturer, AllData.Name, AllData.Address1, AllData.Address2, AllData.Address3, AllData.County, AllData.Tel, AllData.Fax, AllData.Email, AllData.Website, AllData.Proprietor, AllData.Chef, AllData.Member1, AllData.Location, AllData.Description, AllData.Additional_Info, AllData.Wheelchair_Access, AllData.OH_Lunch, AllData.OH_Dinner, AllData.Closed, FROM AllData where 1=1"; if($searchByCounty !="All" && $searchByCounty !="") { $query_Recordset1 = $query_Recordset1 . " AND AllData.County Like '%" . $searchByCounty . "%'"; } if ($searchByCategory =="Restaurant") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Restaurant = 1"; } else if ($searchByCategory == "Producer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Producer = 1"; } else if($searchByCategory == "Cookery_School") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Cookery_School = 1"; } else if($searchByCategory == "Caterer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Caterer = 1"; } else if($searchByCategory == "Consultant") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Consultant = 1"; } else if($searchByCategory == "Accomodation") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Accomodation = 1"; } else if($searchByCategory == "Patron") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Patron = 1"; } else if($searchByCategory == "Freelance") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Freelance = 1"; } else if($searchByCategory == "Lecturer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Lecturer = 1"; } $Recordset1 = mysql_query($query_Recordset1, $Testing) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?>
  3. Hi - I am sure this is very simple but as I am so new to PHP and working with someone elses code I am just fumbling along at the moment - any help/suggestions would be appreicated - Thanks a mill FIREFOX ERROR WHEN TESTING THE SEARCH FUNCTION 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 'FROM AllData where 1=1 AND AllData.Restaurant = 1' at line 1 CODE - FROM SEARCH RESULTS PAGE <?php require_once('connections/testing.php'); ?> <?php //search value $searchByCounty = $_POST['county']; $searchByCategory = $_POST['category']; mysql_select_db($database_Testing, $Testing); $query_Recordset1 = "SELECT AllData.Restaurant, AllData.Producer, AllData.Cookery_School, AllData.Caterer, AllData.Consultant, AllData.Accomodation, AllData.Patron, AllData.Freelance, AllData.Lecturer, AllData.Name, AllData.Address1, AllData.Address2, AllData.Address3, AllData.County, AllData.Tel, AllData.Fax, AllData.Email, AllData.Website, AllData.Proprietor, AllData.Chef, AllData.Member1, AllData.Location, AllData.Description, AllData.Additional_Info, AllData.Wheelchair_Access, AllData.OH_Lunch, AllData.OH_Dinner, AllData.Closed, FROM AllData where 1=1"; if($searchByCounty !="All" && $searchByCounty !="") { $query_Recordset1 = $query_Recordset1 . " AND AllData.County Like '%" . $searchByCounty . "%'"; } if ($searchByCategory =="Restaurant") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Restaurant = 1"; } else if ($searchByCategory == "Producer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Producer = 1"; } else if($searchByCategory == "Cookery_School") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Cookery_School = 1"; } else if($searchByCategory == "Caterer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Caterer = 1"; } else if($searchByCategory == "Consultant") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Consultant = 1"; } else if($searchByCategory == "Accomodation") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Accomodation = 1"; } else if($searchByCategory == "Patron") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Patron = 1"; } else if($searchByCategory == "Freelance") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Freelance = 1"; } else if($searchByCategory == "Lecturer") { $query_Recordset1 = $query_Recordset1 . " AND AllData.Lecturer = 1"; } $Recordset1 = mysql_query($query_Recordset1, $Testing) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?>
×
×
  • 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.