close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Auto redirect to Last record

Thread began 11/22/2011 12:12 am by Daryl | Last modified 11/23/2011 3:48 am by Daryl | 1619 views | 4 replies |

DarylBeta Tester

Auto redirect to Last record

I have a page which uses a URL variable to get its data from a database

news-detail.php?News=1

Is there a way to get the page to redirect to the last record if no URL variable is present?

ie news-detail.php would get redirected to news-detail.php?News="Last Record"

Sign in to reply to this post

CraigRBeta Tester

what i would do is use the News ID from your url parameter as your recordset filter.

you could have an additional recordset on your page which would return the Max news ID from your table

something like "SELECT max(NewsID) AS MaxNewsID FROM tblnews"

if the recordset returns no rows (ie you have no matching record) you use this instead of the url parameter as your recordset filter

Sign in to reply to this post

DarylBeta Tester

So is there a way of 'showif' url variable, 'showif' no url variable?

Sign in to reply to this post

CraigRBeta Tester

what i meant was using the server behavior

show if recordset is empty/not empty

if the recordset returns a row, you show the information returned

if the recordset doesnt return a row, your max news id would come into play

so the psudologic would be..

if first recordset returns a row, show it
if first recordset is empty, use the max news id that is present as a filter instead

Sign in to reply to this post

DarylBeta Tester

Ah I see - pretty obvious realy

Thanks for your idease!

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