close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Values in a Menu

Thread began 4/07/2011 2:03 pm by hbibizadeh396670 | Last modified 4/08/2011 10:36 am by Jason Byrnes | 2128 views | 11 replies |

hbibizadeh396670

Dynamic Values in a Menu

Hi

I have made an admin end for my comment system.

I filter the posts on pages using a unique field in the database.

This works as follows, when a person submits a comment they submit a value defined by a hidden field.

As a result, comments from the same page have the same value in the field of the database. For example 1

However this has created a small problem.

In the admin, I would like to use the field to allow the admin to search for comments based on a particular page.

As a result, I have a dynamic menu/list set up to show the value of the database field.

The problem is, posts from the same page have the same value in the database field. Creating multiple posts in the database field with the same value.

the problem is that the same value or comment page, appears multiple times.

How to I only allow the unique values to display in the menu/list.

Thanks in advance.

If this is not possible do you have any ideas on how I could do this

thanks

Sign in to reply to this post

Jason ByrnesWebAssist

add a group by clause to the recordset:


SELECT * FROM tblName GROUP BY columnName

Sign in to reply to this post

hbibizadeh396670

Could you expand on this.

Im not too sure I understand

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

you need to use the GROUP BY argument in your recordset:
GROUP BY columnName

where columnName is the name of the column you dont want to have repeated values for.

Sign in to reply to this post

hbibizadeh396670

Ok that works but now the search does not work, it just returns with everything

Not sure why

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of your pages so i can see the code and a link where i can see the problem in a browser to investigate.

Sign in to reply to this post

hbibizadeh396670

Hi yep sure

I attached the files and the links below


Link to comment page

Comment.php


Link to admin search

siteezy_comments_Search.php

The database only has two files, if you search. Each seach only should retun one result




Please note: I have not made a design yet just building the system

thanks

Sign in to reply to this post

hbibizadeh396670

Sorry forgot to attach the files.

here they are

thanks

Sign in to reply to this post

Jason ByrnesWebAssist

to help troubleshoot:

change the following code:

php:
<div class="WADAResultDescription"><?php echo $row_WADAsiteezy_comments["Comment"]; ?></div>



to:

php:
<div class="WADAResultDescription"><?php echo $row_WADAsiteezy_comments["Comment"]; ?>||<?php echo $row_WADAsiteezy_comments["UniquePage"]; ?></div>




and add the following code just after the <body> tag:

php:
SQL: <?php echo($query_limit_WADAsiteezy_comments); ?><br />
Sign in to reply to this post

hbibizadeh396670

Thanks for the help

I think I did it right.

I added it on the results page?

I did the code but it seems to have given me an error.

SQL: SELECT CommentID, CommentName, UserEmail, Comment, UniquePage, TimeStamp, URL FROM siteezy_comments WHERE ((UniquePage = 0)) ORDER BY TimeStamp DESC LIMIT 0, 10

at the bottom of the page?

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