PDA

View Full Version : Searching / Filtering Database results in Dreamweaver


JayC555
10-15-2012, 05:39 PM
Hi,

I was just wondering if anyone could please help me out :)
I'm new to Dreamweaver and I'm kind of floundering at the moment!

So. basically I'm wondering how I can filter results from an 'all records' table on my site? I was hoping to create a search option on one page with a drop-down menu choice (I've tried adding a form/button but can't get that working either...), say for example 4 different countries. Choosing one of those country choices would return only the table information relevant to that country.

The 'all records' table is not viewable to the public, I'm trying to pull the search results from that and make that available to the viewer on the same page as the search box/drop down menu...?

I can't find anything on the web that I can get my head around or that offers a Dummies Guide walkthrough. Go easy on me folks, I'm a complete nooby! :)

If it offers any insight: my database is an accomodation list covering 4 countries, it's quite small as it's only a test run.


Thanks in advance for any help or info folks, my head is numb trying to get this sorted out.

edbr
10-16-2012, 04:06 AM
the select statement would do it , you can use a form to send a $_POST variable of different values.
example if your select statement is SELECT * from table $_POST['form'] :
your form could send a null value for all, or where country=america etc

JayC555
10-17-2012, 02:13 PM
the select statement would do it , you can use a form to send a $_POST variable of different values.
example if your select statement is SELECT * from table $_POST['form'] :
your form could send a null value for all, or where country=america etc

Many thanks for your help, I'll give it a shot, but as this is all new to me I'm lost! :)

One final question if I may:

I have created my page with a width of 1000 pixels (height set to Auto) to accommodate various screen sizes etc. Is there any way I can create a rule or something that fills the white space either side of my page proper with a defined image or colour that adapts to the environment it is being viewed in ? - I cannot for the life of me figure this out...

Thanks again

edbr
10-18-2012, 02:19 AM
i would use a wrapper for my page
a quick example
<html>
<head>

<style>
body{ background: #000; margin: 0 ;}
#wrap{ width:1000px; position:relative; margin: 0 auto 0 auto; background: #fff;}
</style>
</head>
<body>
<div id=wrap>
ddddddddddddddddddddddddddddddddd
</div>
<body></html>

I have basically made the body black but you can choose a color or image for it. Im not sure what you mean by adapts to the environment it is being viewed in

JayC555
10-18-2012, 01:49 PM
i would use a wrapper for my page
a quick example
<html>
<head>

<style>
body{ background: #000; margin: 0 ;}
#wrap{ width:1000px; position:relative; margin: 0 auto 0 auto; background: #fff;}
</style>
</head>
<body>
<div id=wrap>
ddddddddddddddddddddddddddddddddd
</div>
<body></html>I have basically made the body black but you can choose a color or image for it. Im not sure what you mean by adapts to the environment it is being viewed in


Hello again and many thanks for your help,

Sorry if I have not explained myself very well, I'm new to all this :)

What I mean is that my site is very simple, each page uses the same template (width 1000 px, height auto). I'm trying to fill the whitespace outside of the page proper with either an image or background colour, specifically for aesthetics. I don't really care how much is lost when viewed through differing monitor sizes, this is why I centred the page proper and gave it a reasonably small width to try and make it universally viewable. I've copied in the code below if you want to take a look, cheers!

So, do I just created a wrapper around the entire page and set the width to be be 1500 px or something? If so, how would I do that - do I have to manually type it in to my code or can I do it through the Dreaweaver GUI?

Thanks again for your help!

JC


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#wrapper {
height: auto;
width: 1000px;
margin-right: auto;
margin-left: auto;
background-color: #999;
background-image: none;
}
#header {
background-color: #000;
float: left;
height: auto;
width: 1000px;
margin-bottom: 10px;
}
#navbar {
background-color: #CCC;
float: left;
height: auto;
width: 120px;
margin-right: 10px;
border: 5px none #000;
padding-right: 10px;
padding-left: 10px;
font-size: 16px;
color: #009;
text-transform: uppercase;
font-style: normal;
font-weight: bold;
font-family: "Courier New", Courier, monospace;
}
#imagebar {
background-color: #FFF;
float: left;
height: 225px;
width: 850px;
}
#imagetext {
background-color: #CCC;
height: auto;
width: 840px;
padding: 5px;
float: left;
}
#wrapper2 {
float: right;
height: auto;
width: 850px;
background-color: #CCC;
}
#contact {
background-color: #CCC;
float: left;
height: auto;
width: 1000px;
margin-right: 10px;
margin-top: 10px;
color: #999;
}
#wrapperall {
float: left;
height: auto;
width: 1000px;
background-color: #999;
background-image: url(images/countrypagerepeat.jpg.jpg);
background-repeat: repeat;
}
</style>
</head>

<body>
<div id="wrapper">
<div id="header">
<div align="center">
<h1><img src="images/Banner.jpg" width="785" height="146" alt="Shoestring Vagabond Site Title Banner" /></h1>
</div>
</div>
<div id="wrapperall">
<div id="navbar">
<p>&nbsp;</p>
<p><a href="index.html">Home</a></p>
<p>About </p>
<p><a href="region-thailandpage.html">Thailand</a></p>
<p><a href="region-cambodiapage.html">Cambodia</a></p>
<p><a href="region-laospage.html">Laos</a></p>
<p><a href="region-vietnampage.html">Vietnam</a></p>
<p>Guidebooks</p>
<p>Teaching Jobs</p>
<p>FAQ</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div id="wrapper2">
<div id="imagebar"><img src="images/Bangkok.jpg" width="850" height="225" alt="Bangkok at night" /></div>
<div id="imagetext">
<h1>Thailand
</h1>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
</div>
<div id="contact">
<div align="center">Shoestring Vagabond 2012. All queries: admin@vagabond.com</div>
</div>
<div id="sitemap">
<div align="center">
<h2>&nbsp;</h2>
</div>
</div>
</div>
</body>
</html>

edbr
10-20-2012, 02:38 AM
you need to create the wrapper div then you can select all the page between <body> and </body> then insert div and the wrap around selection option