close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Linking from UserName in the database table to a new page

Thread began 3/28/2019 12:55 pm by balexander389215 | Last modified 4/04/2019 1:48 pm by Ray Borduin | 137 views | 20 replies |

balexander389215

Linking from UserName in the database table to a new page

Hi, Following the tutorials I have created a page that displays the information from the database on a page. (much easier using the SQLi) The table populates fine displaying the information. What I want to do is have it so that if someone clicks on the username in the table it will then them to a profile page displaying more and more in-depth information on that particular username. I assume that I will have to create a recordset binding the information i want shown on the profile page but how do I set it up so that it is the particular username that is displayed?

Thanks

Brian

Sign in to reply to this post

Ray BorduinWebAssist

Add a url parameter to the link passing the ID from the recordset, so the link would look like: detailspage.php?id=5

Then on the details page you can filter the recordset by the url parameter to only show the record that matches the passed id.

Sign in to reply to this post

balexander389215

I just realized that since my data is displayed as a repeat region I can't actually create links from an individual name. Is this still possible?

Sign in to reply to this post

Ray BorduinWebAssist

Yes, you just add the dynamic url parameter from the recordset you are looping with.

Sign in to reply to this post

balexander389215

I'm sorry Ray, I don't understand. My search page is here under. Very simple. when I preview in the browser It gives me a list of information in the database. Say the first name is Abe. I want a way to click on Abe and take to a profile page giving more information about Abe, but I can find no way to create a link from Abe as his name does not exist on the php page until the information is called from the database in the browser. So perhaps what I want to do is not possible after all.

Sign in to reply to this post

Ray BorduinWebAssist

php:
<td> <?php echo($Song1->getColumnVal("UserFirstName")); ?></td>


becomes:

php:
<td> <a href="details.php?id=<?php echo($Song1->getColumnVal("UserID")); ?>"><?php echo($Song1->getColumnVal("UserFirstName")); ?></a></td>
Sign in to reply to this post

balexander389215

Not quite there, but getting closer. When I preview the names and click on one of them, any one I get the same profile each time, which is the profile for UserId 1. Any idea what's missing?

Sign in to reply to this post

Ray BorduinWebAssist

You have to filter the recordset on the profile to bring up the record passed in the url parameter from the previous page. If you open your recordset and go to the "Simple" view it will give you the option to add a filter.

Sign in to reply to this post

balexander389215

I get the message that simple dialog box cannot be opened because SQL is too complex. Is there another way to set the necessary filter and what filter do I need to set?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

I think your SELECT statement is wrong to begin with. Change it to just: SELECT * FROM users

and then go from there and it will allow you to go to the simple recordset dialog.

Sign in to reply to this post
loading

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