Hello.
I am retired, 70 years old and new to php and wordpress. Not to be completely stupid, I did some homework learning everyday 10 hours a day for the last month or so but my time is limited so I finally decided to seek some help from a helpful hand.. I need baby steps (or a walker) helping me finish this.
mysql is version 5.5.40 I am using wordpress that I had to learn in the process.
http://snapps.riverviewproject.com/?page_id=6
I created a custom form for members registration to feed the database and this is workling. so far so good
In my home page I created a search form for visitors to retrieve selected members according to their location (drop-down menu with available zip codes) and specialties (Check-box)
I am getting close but cannot find what I am looking for to finish this.
I am like a dog trying to bite his tail, but not being one I do not have this luxury!
:)
Thanks in advance.
in short here are my problems:
1) from the search form on the left column, whatever pet service a visitor choose in their own zip code, or even no selection at all, the result gives ALL members in the database - regardless of their specialty or zip code covered - instead selected ones from the submit button. (to sumplify, so far I only mentionned 2 members in the database with one zipcode / one specialty each out of 19 members, 25 specialties and 90 zipcodes.
Fairly simple as it seems but quite a mountain to climb for my old legs. help me reach the summitt please!
2) The search results are showing in the same column as the form that is too narrow. I am trying to show the results in the "result page" http://snapps.riverviewproject.com/?page_id=724
[removed url]
I really like to keep this search form on the home page left column, so it is available at first glance.
3) finally, results are displaying in one block,(it took me 2 weeks to realize this exploit !YES ! but it is not very pretty or easy to read. I found out how to make a title but cannot separate the words. The member's bio (with eventual picture) will be more complete so It needs to be separated paragraph.
( also, do I have to place each 60 zip code on a different field in the database and is there a way to avoid mentioning them again in separate line in the php ?)
ie:echo $row[zipcode -89109]."";etc... 60 times or so....
Is there a shorter way to do this?
-----------------------------------
search.HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/></head>
<body bgcolor="#FFFFFF">
<center>
<script type="text/javascript" src="swfobject.js"></script><div id="CC8404954">Form Object</div><script
type="text/javascript">var so = new SWFObject("search.swf", "search.xml", "275", "546", "7,0,0,0", "#ffffff");so.addParam("classid",
"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");so.addParam("quality", "high");so.addParam("scale", "noscale");so.addParam("salign",
"lt");so.addParam("FlashVars", "xmlfile=search.xml&w=275&h=546");so.write("CC8404954");</script>
</center>
</body>
</html>
--------------------------
search.php
<?php
$db = mysql_connect("localhost","pierjean","*********");
if (!$db) {
die("Database connection failed miserably: " . mysql_error());
}
$db_select = mysql_select_db("snapps",$db);
if (!$db_select) {
die("Database selection also failed miserably: " . mysql_error());
}
?>
<?php
$db = mysql_connect("localhost","pierjean","********");
if (!$db) {
die("Database connection failed miserably: " . mysql_error());
}
<html>
<head>
<title>members</title>
</head>
<body>
IN CONSTRUCTION. TRY OUT ONLY. Please try again later.than you
<div class="cssstyle">
<?php
$result = mysql_query("SELECT * FROM members", $db);
if (!$result) {
die("Database query failed: " . mysql_error());
}
while ($row = mysql_fetch_array($result)) {
echo "<h2>";
echo $row[company]."";
echo "</h2>";
echo "<p>";
echo $row[firstname]."";
echo $row[lastname]."";
echo $row[phone]."";
echo $row[website-url]."";
echo $row[Email]."";
echo $row[Bio]."";
echo $row[11]."subcategory-Exotics";
echo $row[zipcode-89102]."";
echo $row[zipcode -89109]."";
echo $row[Overnight-stay]."";
echo "</p>";
}
?>
</div>
</body>
</html>
<?php
mysql_close($db);
?>