close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple listings sort by primary key

Thread begun 2/14/2011 7:57 pm by johnfrancis227818 | Last modified 2/18/2011 4:36 pm by jon_upton | 3978 views | 7 replies |

johnfrancis227818

Multiple listings sort by primary key

Hi,

I am only getting the first address from the 1000's of customers that my site has. How do I display this map on their "profile" page based on that page's primary key for other profile data from the user.

mysql_select_db($database_mappie, $mappie);
$query_AddressSet = "SELECT address, address2, city, stateprov, postalcode FROM pbn_contact";
///////////////////////////////

do I need to put WHERE CKEY= "the CKEY already connected to their record"
this is already defined on my page that I want to display the map by member:
$url = INSTALLPATH . "fullpage.php?ckey=" . $ckey;



////////////////////////////////////////////
$AddressSet = mysql_query($query_AddressSet, $mappie) or die(mysql_error());
$row_AddressSet = mysql_fetch_assoc($AddressSet);
$totalRows_AddressSet = mysql_num_rows($AddressSet);
?>


/////////////////////////
If you know the proper syntax, I would appreciate it.. I can read PHP, but I can't write it.

-JF

Sign in to reply to this post

Jason ByrnesWebAssist

In the recordset, go to the filtering section, select the CKEY Column, and set it to filter on the URL Variable ckey. This will create the proper syntax for you.

Sign in to reply to this post

johnfrancis227818

Originally Said By: Jason Byrnes
  In the recordset, go to the filtering section, select the CKEY Column, and set it to filter on the URL Variable ckey. This will create the proper syntax for you.  



Hi Jason,

This will not work. My listings utilize two related database tables. The address presented in the listing comes from a table called "contact", the CKEY, which comes from the "listings" table is the primary key for the listing information, such as logo, description, rating, etc... The CKEY appears in the URL string in the address bar. All of the information that is displayed on their listing page is referenced from the CKEY.

So, whenever I change to a different member, the map should change to the address that is associate with the profile. Using the recordset function is limited in Dreamweaver. How do I cross over to gather the address from "contact" table and have it show the proper map?

-j

Sign in to reply to this post

jon_upton

Take a look at this site

Hi John

Have a look at this site www.chrismcavoylettings.co.uk all the mapping is done in propmaps with minor hand alteration to set the centre and the level of magification.

This is houses you say but the issue is just the same as members there is a list and/or a map showing all the houses and then a detail page for each house same as a members list and a profile.

The switch from list to detail is managed by the standard Dreamweaver go to detail behaviour which should resolve your sql - the problem is nothing to do with Promaps but is down to you creating the correct sql that reads the parameter (ckey) passed from the list table to the second/detail page from your second table and then using the resulting single record file as the datafile in propmaps.

Hope this helps

Jon

Sign in to reply to this post

johnfrancis227818

Originally Said By: jon_upton
  Hi John

Have a look at this site www.chrismcavoylettings.co.uk all the mapping is done in propmaps with minor hand alteration to set the centre and the level of magification.

This is houses you say but the issue is just the same as members there is a list and/or a map showing all the houses and then a detail page for each house same as a members list and a profile.

The switch from list to detail is managed by the standard Dreamweaver go to detail behaviour which should resolve your sql - the problem is nothing to do with Promaps but is down to you creating the correct sql that reads the parameter (ckey) passed from the list table to the second/detail page from your second table and then using the resulting single record file as the datafile in propmaps.

Hope this helps

Jon  




Thanks Jon,

Very speedy reply, but this doesn't help. Please read my first post on this subject. I think that is what you are talking about.

here's what the site looks like:

fullpage2.php?ckey=36

Change the CKEY in the URL from 36 to 9 and you'll see what I mean.



The box in the top right is where I want the map to display. I just need the code "WHERE" parameter in the PHP/MySQL.. Like I said, I can read PHP, but I can't write it.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, so you have a users table and an address table?

How are you relating the address to the user?

there should be a column in the address table that creates a relationship to the user that the address belongs to, you would need to create a joined query using this relational column and add the where clause using ckey query sting variable.


See the following page for details on creating a join query to get related information from 2 tables:
sql_join.asp

Sign in to reply to this post

johnfrancis227818

Originally Said By: Jason Byrnes
  Ok, so you have a users table and an address table?

How are you relating the address to the user?

there should be a column in the address table that creates a relationship to the user that the address belongs to, you would need to create a joined query using this relational column and add the where clause using ckey query sting variable.


See the following page for details on creating a join query to get related information from 2 tables:
sql_join.asp  



Thanks for the link, but it won't help. My issue is more complex than what w3 can do and less difficult than what is really happening. Once again, please look at my code that I pasted in the first post. The CKEY is the customer listing. The address comes from the "contact" table, so, both the address and the listing info is already on this page. How do I change the map code so that it's picking up the CKEY

do I need to put WHERE CKEY= "the CKEY already connected to their record"
this is already defined on my page that I want to display the map by member:
$url = INSTALLPATH . "fullpage.php?ckey=" . $ckey;



////////////////////////////////////////////
$AddressSet = mysql_query($query_AddressSet, $mappie) or die(mysql_error());
$row_AddressSet = mysql_fetch_assoc($AddressSet);
$totalRows_AddressSet = mysql_num_rows($AddressSet);
?>



ACTUALLY JOIN will not work. This is a session parameter based on the url.

I have to pick up the URL CKEY=36 and have that affect the map. Joining will just give me the same map over and over again since it's a preset query.

So, how do I get my map to show the address that is based on the CKEY already set in the PHP?

Sign in to reply to this post

jon_upton

Have a look at this doc

promaps.zip

It might help you get the gist of using dynamic fields in ProMaps

regards

Jon

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...