HighDots Forums  

gathering information from stored URL

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss gathering information from stored URL in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jsteinmann
 
Posts: n/a

Default gathering information from stored URL - 06-09-2008 , 10:00 PM






I am setting up email alerts for people where they can select a variety of
options, and if criteria matches all the options they choose, they get an email
letting them know they have a match to view.

Since I use a get form for the search results page, I figured that would be a
good way to store the email alerts options as well. I am able to store the URL
string of parameters very nicely using $url=$_SERVER['QUERY_STRING']; echo
$url; and saving that in the database. However, I'm not sure how I can extract
data from that string other then using the $_get .... but I don't have an
option of using the address url since it will be looping though all the email
alerts data finding matches and spitting out emails.

Any ideas on how to do this?


Reply With Quote
  #2  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-09-2008 , 10:19 PM






.... and if I can loop through an entire table of stored url query strings, and
extract that data and match it against stored data that matches those email
alert options, would it be better to just store each variable in individual
columns as an array in the database, and then implode those arrays into a
format where it can be compared against the data it needs to match? If so, how
can I store arrays in the database and extract them successfully. I didn't
understand serialize and how to work with that, and didnt know if there was
another way.


Reply With Quote
  #3  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-09-2008 , 10:19 PM



.... and if I can loop through an entire table of stored url query strings, and
extract that data and match it against stored data that matches those email
alert options, would it be better to just store each variable in individual
columns as an array in the database, and then implode those arrays into a
format where it can be compared against the data it needs to match? If so, how
can I store arrays in the database and extract them successfully. I didn't
understand serialize and how to work with that, and didnt know if there was
another way.


Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 09:47 AM



..oO(jsteinmann)

Quote:
I am setting up email alerts for people where they can select a variety of
options, and if criteria matches all the options they choose, they get an email
letting them know they have a match to view.

Since I use a get form for the search results page, I figured that would be a
good way to store the email alerts options as well. I am able to store the URL
string of parameters very nicely using $url=$_SERVER['QUERY_STRING']; echo
$url; and saving that in the database. However, I'm not sure how I can extract
data from that string other then using the $_get ....
Try parse_str(). But if you really want to perform a DB search on that
to find matching records, you should use a better table design. Just
throwing multiple pieces of informations into a single table column like
in this cases already violates the first normal form of database design.
Really bad thing.

But how to actually structure the table(s) depends on the data you have
and what you want to do with it. Proper DB designs take some time.

Micha


Reply With Quote
  #5  
Old   
Michael Fesser
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 09:47 AM



..oO(jsteinmann)

Quote:
I am setting up email alerts for people where they can select a variety of
options, and if criteria matches all the options they choose, they get an email
letting them know they have a match to view.

Since I use a get form for the search results page, I figured that would be a
good way to store the email alerts options as well. I am able to store the URL
string of parameters very nicely using $url=$_SERVER['QUERY_STRING']; echo
$url; and saving that in the database. However, I'm not sure how I can extract
data from that string other then using the $_get ....
Try parse_str(). But if you really want to perform a DB search on that
to find matching records, you should use a better table design. Just
throwing multiple pieces of informations into a single table column like
in this cases already violates the first normal form of database design.
Really bad thing.

But how to actually structure the table(s) depends on the data you have
and what you want to do with it. Proper DB designs take some time.

Micha


Reply With Quote
  #6  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 11:56 AM



ok, well I changed it so I'm capturing the search string as well as added a
column for each search variable. I'm using the implode to seperate
the arrays with commas... like this...

$education = ''.implode(',',$_GET['education']).'';

and then insert record like this...

<input name="education" type="hidden" value="<?php echo $education; ?>">

The data then will be either % for all, or will look like this:

Bachelors Degree,Masters Degree,Other
Where those 3 options were selected

So now my question is, how do I get this back out to filter the recordset? I
have this so far:
if (isset($row['education']) != "") {
$query .= " WHERE education LIKE '{$row_rs['education']}'";
}


... but I know that's not right because I have commas and it needs to check
each answer.





Reply With Quote
  #7  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 11:56 AM



ok, well I changed it so I'm capturing the search string as well as added a
column for each search variable. I'm using the implode to seperate
the arrays with commas... like this...

$education = ''.implode(',',$_GET['education']).'';

and then insert record like this...

<input name="education" type="hidden" value="<?php echo $education; ?>">

The data then will be either % for all, or will look like this:

Bachelors Degree,Masters Degree,Other
Where those 3 options were selected

So now my question is, how do I get this back out to filter the recordset? I
have this so far:
if (isset($row['education']) != "") {
$query .= " WHERE education LIKE '{$row_rs['education']}'";
}


... but I know that's not right because I have commas and it needs to check
each answer.





Reply With Quote
  #8  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 11:11 PM



do i need to explode the data?

Reply With Quote
  #9  
Old   
jsteinmann
 
Posts: n/a

Default Re: gathering information from stored URL - 06-10-2008 , 11:11 PM



do i need to explode the data?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.