close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

select help

Thread began 9/10/2018 7:34 am by Jamie | Last modified 9/11/2018 12:31 pm by Ray Borduin | 18 views | 7 replies |

Jamie

select help

Hey Ray

Have got a drop down in the back end tht the user can select 'location1', 'location2' or both - these are not dynamic - location1 = 1, location2 = 2 and both = 0

On the front end, have got a dynamic page which am trying to show the relevant content appropriate to that page which am trying to get to show the teammembers based on what they have stored in StaffLocation (either 0, 1 or 2)

If 0, then they need to be shown on both pages, if they are only in 1 or the other location to then show them on that page only.

thanks

Sign in to reply to this post

Ray BorduinWebAssist

What happens when you make the change in the admin? Does it get saved in the database? What column should be filtered on the front end from what table? I'm just a little confused about the details of how it should work and that is preventing me from being able to advise you on how to do it.

Sign in to reply to this post

Jamie

Yes, it gets stored in the db in the staff table in column StaffLocation (and its saved as either 0,1 or 2)

Sign in to reply to this post

Ray BorduinWebAssist

Then on the front end what table and column are you wanting filtered based on that result. I'm still confused about that part.

Sign in to reply to this post

Jamie

ok sorry. the page main content is coming from the PageContents rs and the TeamMember rs needs to show the staff based the 2 locations that are in the about navigation drop down: http://clients.motley.site/step/location/salisbury

Sign in to reply to this post

Ray BorduinWebAssist

SELECT * FROM staff WHERE Live = 1 AND (StaffLocation = ? OR StaffLocation=0) ORDER BY StaffOrder ASC

And then use a parameter to set the StaffLocation to 1 or 2 based on which location you are viewing by passing in a url parameter.

Sign in to reply to this post

Jamie

like this?

$TeamMember = new WA_MySQLi_RS("TeamMember",$DBConnection,0);
$TeamMember->setQuery("SELECT * FROM staff WHERE Live = 1 AND (StaffLocation = ? OR StaffLocation=0) ORDER BY StaffOrder ASC");
$TeamMember->bindParam("i", "".(isset($_GET['loc'])?$_GET['loc']:"") ."", "-1"); //StaffLocation
$TeamMember->execute();
Sign in to reply to this post

Ray BorduinWebAssist

Sure, if you are passing in the StaffLocation value from the url.

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...