Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

recordsets....

Guest
Jan 09, 2008 Jan 09, 2008

Copy link to clipboard

Copied

Hello. I know this may be simple to many but I am going to ask it anyways because I am stumped badly. Ok I need to be able to pull up info from a database with people and info from each county in each state, do I have to create a recordset for each county selected? Do you have to create one for each time you try to display the details page also? Is there another way to do this? Please help! Sorry if this seems stupid to some but I am trying here!

Thanks!!!!
TOPICS
Server side applications

Views

2.0K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> Hello. I know this may be simple to many but I am going to ask it anyways
> because I am stumped badly. Ok I need to be able to pull up info from a
> database with people and info from each county in each state, do I have to
> create a recordset for each county selected?

One recordset will do. You order the results by state and county using
an ORDER BY clause in your SQL. A simple example:

SELECT id, name, county, state
FROM myTable
ORDER BY state, county, name

> Do you have to create one for
> each time you try to display the details page also?

The details page needs just one recordset that uses a URL parameter
(usually the record's primary key) as a filter.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

ah ok makes much more sense now. when they click a state, they are sent to that states page. from there they can select a county to pull up the information, what is the best way to present the counties? drop down/menu list? list them on the page? I figured a drop down would be with the list of each states counties..... what is your thought?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> ah ok makes much more sense now. when they click a state, they are sent to
> that states page. from there they can select a county to pull up the
> information, what is the best way to present the counties? drop down/menu
> list? list them on the page?

Most states are likely to have a lot of counties, so a drop-down would
probably be more sensible.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

so when i make this recordset, i can use it for all counties by using the 'where' for each county that can be used as one recordset right?

with the drop down list, you link that search page to the results page where the recordset it that displays the data on the results page. am i on the right track? you dont need a recordset on the search page from what i read, or is that wrong?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 11, 2008 Jan 11, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> so when i make this recordset, i can use it for all counties by using the
> 'where' for each county that can be used as one recordset right?

Why don't you try it? Or are you completely new to working with recordsets?

> with the drop down list, you link that search page to the results page where
> the recordset it that displays the data on the results page. am i on the right
> track? you dont need a recordset on the search page from what i read, or is
> that wrong?

There are many different ways of doing things. It's very common for
search pages to use a self-processing form, so when you click the search
button, the same page reloads, and processes the code to create the
recordset and display the results. Alternatively, you can send the
search criteria from the form to a separate results page. If you do
that, the recordset is, of course, in the results page.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 11, 2008 Jan 11, 2008

Copy link to clipboard

Copied

yes i am fairly new but you gotta learn sometime and i am not afraid to admit it. the problem is i have no data in my database yet, there will be some as it starts, like a forum in a sort.... so i think that is where i am getting confused. i was new to it but i figured everything out with no help and on my own but i am stumped on this part with how to create a search page that can look up info by county names and present it on the html table. it may be easy for you but somehow the harder things are easier for me to figure out than the easy stuff but if you could help in anyways i would be so greatful.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2008 Jan 12, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> yes i am fairly new but you gotta learn sometime and i am not afraid to admit
> it. the problem is i have no data in my database yet, there will be some as it
> starts, like a forum in a sort.... so i think that is where i am getting
> confused.

Everybody has to start somewhere. Even I was a beginner once! So I
understand the dilemma you're facing. The best approach is to take
things gently. Don't try to build the killer application right from the
start. Build a few small test pages, get to know how everything fits
together. Start by creating a few insert, update, and delete pages.
Don't worry about the contents of the database. You'll make mistakes as
you go along, so it's best to have a test database to play with while
you're learning.

The key to building search pages is learning the way you build SELECT
queries so that your recordset contains only those results that you
actually want.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 13, 2008 Jan 13, 2008

Copy link to clipboard

Copied

ha yeah! see thank you for understanding! i totally understand all the language with it (select, where, order by) i just cant seem to figure out how to create that one recordset for a list of counties to pull up....

everytime i create one or try something different, it brings up all the info instead of just the county that was selected from the search page. im thinking i might just have to create a recordset for each county for each state to bring up the requested info? that is alot, but if i gotta do that then thats what i got to do... you said you could create one recordset, how would you write it? right now it looks like this....

select l_name, f_name, street, comment
from my_table
where county=' (this is where i need the help, how can you put this where it wont bring up all but just the one selected???)

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2008 Jan 13, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> select l_name, f_name, street, comment
> from my_table
> where county=' (this is where i need the help, how can you put this where it
> wont bring up all but just the one selected???)

Pass the name of the county to the page through a query string like this:

results.php?county=Orange

You normally do this by submitting a form using the GET method, although
you can also add it to a URL in a link.

In the Recordset dialog box, select URL parameter as the filter, and set
its value to $_GET['county'].

<shameless plug>If you're struggling with all this, you might find my
book, "The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP",
answer a whole pile of questions. As well as covering all the PHP server
behaviors in Dreamweaver, I have an entire chapter devoted to different
search techniques. You can find more details by following the link in my
sig.</shameless plug>

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 13, 2008 Jan 13, 2008

Copy link to clipboard

Copied

i did go look for your book today at booksamillion, they didnt have any in, i will try another place maybe tomorrow.

so with the results.php?county=Orange would you place that on like this?
select l_name, f_name, street, comment
> from my_table
> where county=results.php?county=orange

is that how you would place it?

i tested the $_GET['county']. and it worked when i tested with the counties, so i know i am on the right track, just trying to figure out if i need to put this then list the counties like you did with the php?......

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2008 Jan 13, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> so with the results.php?county=Orange would you place that on like this?
> select l_name, f_name, street, comment
> > from my_table
> > where county=results.php?county=orange
>
> is that how you would place it?

No. In the Recordset dialog box, select Simple mode, and set Filter to

county =
URL parameter $_GET['county']

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 14, 2008 Jan 14, 2008

Copy link to clipboard

Copied

i got your book ordered from amazon! so i will get that in in the next few days.

i tested what you told me out and it works but then when i go to live data it says the query string is not right and so on.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 14, 2008 Jan 14, 2008

Copy link to clipboard

Copied

i also have the missing manual for dreamweaver cs3 and i have been reading posts, forums, etc. is it better to go with spry & ajax to build the seach, results & detail pages or should i just stick with the html pages?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2008 Jan 14, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> is it better to go with spry & ajax to build the seach,
> results & detail pages or should i just stick with the html pages?

Using Spry for search and results pages is less reliable than PHP.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 22, 2008 Jan 22, 2008

Copy link to clipboard

Copied

ok got your book, totally awesome by the way and i am learning alot. but my one question is with the query string.... how exactly does this go from the search field to the results? is it all pretty much dealing in that one $_GET['county']

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2008 Jan 23, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> ok got your book, totally awesome by the way and i am learning alot.

Great.

> but my
> one question is with the query string.... how exactly does this go from the
> search field to the results? is it all pretty much dealing in that one
> $_GET['county']

If your form uses the get method, the form field is called county, and
someone types in "Orange", when the form is submitted it adds
?county=Orange to the end of the URL. PHP can then use $_GET['county']
to retrieve the value entered by the user. Dreamweaver then uses that
value to build the WHERE clause of the SQL query.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

hey! just wanted you to know that your book is great! and just so you know, i totally got it to work, all that stuff i was confused about! im pumped!

i do have one question for you, (i wanted to ask you since i really understood you and you took the time for me)....

Ok I know how to restrict access to a page with the user and so on, but what I need to have is a restricted access to a page that contains a form to fill out after the payment is submitted. I have secure pay set up where they make the payment, after payment they click the link that directs them to the form. Any person who typed in the address could get to the form if they figured it out and bypass the payment. I need to know how to restrict access to this but the thing is, you dont have to have a username and password. So how does this work or how could you specify the page rather than by username and password?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> hey! just wanted you to know that your book is great! and just so you know, i
> totally got it to work, all that stuff i was confused about! im pumped!

Great. Tell all your friends about it, and if you feel inspired, why not
post a short review at one of the online bookstores like Amazon.com?

> I have secure pay set up where they make the
> payment, after payment they click the link that directs them to the form. Any
> person who typed in the address could get to the form if they figured it out
> and bypass the payment.

It depends how your secure payment system works, but the basic principle
is very simple. Presumably, your payment system sends back some form of
reference identifying the payment. The script that captures that
reference needs to store it as a session variable, and pass it through
the query string that redirects the user to the form.

You can then use the session variable and the query string to determine
whether the user is entitled to access the page:

<?php
session_start();
if (!isset($_GET['ref']) || $_GET['ref'] != $_SESSION['ref']) {
header('HTTP/1.1 403 Forbidden');
exit;
}
?>

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2008 Jan 14, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> i got your book ordered from amazon! so i will get that in in the next few
> days.

Great. I hope it helps you sort out a lot of your problems.

> i tested what you told me out and it works but then when i go to live data it
> says the query string is not right and so on.

Live Data view can be tricky at times. If it works in a browser, that's
the main thing.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2008 Jan 12, 2008

Copy link to clipboard

Copied

On Sat, 12 Jan 2008 12:49:04 +0000, David Powers <david@example.com>
wrote:

>Everybody has to start somewhere. Even I was a beginner once!

Yeah, but that was when the abacus was high tech. ;-)

Gary

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2008 Jan 12, 2008

Copy link to clipboard

Copied

Gary White wrote:
> Yeah, but that was when the abacus was high tech. ;-)

I thought it still was. :-p

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2008 Jan 12, 2008

Copy link to clipboard

Copied

On Sat, 12 Jan 2008 15:27:33 +0000, David Powers <david@example.com>
wrote:

>I thought it still was. :-p

<LOL />

Gary

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

will do by telling people, i actually recommended it to a few people stuck on the same thing i was...

i am following you but i dont know how to find out witht the secure pay. it just has a set up where after the payment, you set the page it goes to. with what you wrote, is that to go on my page in dreamweaver or do i need to get that on the after payment page??

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

lilbodi wrote:
> i am following you but i dont know how to find out witht the secure pay. it
> just has a set up where after the payment, you set the page it goes to.

Don't you get any type of acknowledgement from the payment system that
payment has been authorized?

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines