| Author |
Topic Search Topic Options
|
l15aRd
Groupie
Joined: 24 May 2002
Location: England
Status: Offline
Points: 121
|
Post Options
Thanks(0)
Quote Reply
Topic: Rs.movenext help Posted: 31 March 2003 at 4:44am |
I have a couple of ASP problems,
1. I have a DB, can display records, which is great, BUT at the start of each record I have a approved Yes/no field, and want to display only the records the have yes, so I triedsomething along the line of:
if x_aprvd = false then rs.movenext else (rest of record)
<table........
I know the above is not code correct (no delimiters and all, it's just off the top of my head), I have an existing end if, rs.movenext, loop command later on to loop through and display the records.
2. I've managed to add comments to another record (1 to many routeen)and what I would like to do is, on clicking to add a comment to a record, to add the record id to to a field on the comments table so I can then display the comments related to that record, I've managed to list the record ID's in a list, but have gone brain dead and can't think past this one...
Thanx in advance
|
|
|
 |
Scotty32
Moderator Group
Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2003 at 5:10am |
umm didnt quite understand the no. 2 question
and for number 1, i aint sure cose ya said ya did it off the top of ya head, but is it cose it doesnt have quotes round the "false" ... like that?
|
 |
l15aRd
Groupie
Joined: 24 May 2002
Location: England
Status: Offline
Points: 121
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2003 at 5:37am |
the code line above isn't the exact script, it's just an example for quickness, but goes along those sort of lines, but it maybe completely different...it's just the way I was attempting to do it.... I can get the exact code 2night at home, I don't have it with me at work :(
I don't think that the testing value would have to be in "" as it's either Ture or false and not Text, as the text would be represented as "yes" or "no"
Edited by l15aRd
|
|
|
 |
ultramods
Groupie
Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2003 at 7:52am |
For question one why dont you just use select * from table where x_aprvd = True. This would be faster as it would return less results from the origional query, also you wouldnt have to use the if statement.
Edited by ultramods
|
 |
l15aRd
Groupie
Joined: 24 May 2002
Location: England
Status: Offline
Points: 121
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 March 2003 at 8:07am |
|
will try that 2night, and get back to ya...:)
|
|
|
 |
l15aRd
Groupie
Joined: 24 May 2002
Location: England
Status: Offline
Points: 121
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 April 2003 at 4:56am |
I used the string
Select * FROM [tblinks] WHERE [link_aprvd] = true
So thanks Ultramods for that,
now all I need to do is, I have a links table and a comments table, and want people to post comments about the links, I have a duplicate field on both tables called [Link_id], how do I set the [Link_id] on the comments table to the value of the record they want to comment on?? (abit like posting a comment on the forum)
Thanx again for any help given
|
|
|
 |
ultramods
Groupie
Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 April 2003 at 5:13am |
For each link you could have a button called "comment". When they click on the button it go's to a page where they can comment on the link. The url for this page would have a queryString for the linkID.
For example. www.youdomain.co.uk/commentOnLink.asp?linkID=2
Let the users add there posts then enter all the details into your comments table including the linkID. ie rs("linkID") = linkID
|
 |
l15aRd
Groupie
Joined: 24 May 2002
Location: England
Status: Offline
Points: 121
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 April 2003 at 5:32am |
|
Once again you've come up trumps, will try it tonight, adn let you know, and then the fruits of my work will be available for all to see, a (links manager, with admin section and all) and if anyone wants it, I'll make a downloadable version, with out my site customisations
|
|
|
 |