0
Explorer
,
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/td-p/708032
Nov 23, 2006
Nov 23, 2006
Copy link to clipboard
Copied
I have a page with a repeating recordset, with one dynamic
variable called Event that I would like to display as a link only
if there is a link entered in the link field. When I use data
source and select the link field as my link, it also shows all of
the other Event entries, the ones with no data in the link field,
as links to the current page. Is there any way I can have the Event
show as a link only if the event link field contains data?
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
Nov 25, 2006
Nov 25, 2006
On Sat, 25 Nov 2006 17:30:13 +0000 (UTC), "kllw"
<webforumsuser@macromedia.com> wrote:
>Thanks, Dave. I'm actually using PHP/MySQL. How can I use the Show if Recordset
>not empty when the field is a part of a larger recordset? It's pulling all
>dates for a schedule, some of which are a special event. I always want the text
>of the special event to show, but make that text a link only if there is a link
>in the link field.
You could have:
<td>
<?php
if ( is_null($row_rsMyRecordset['ev_link...
<webforumsuser@macromedia.com> wrote:
>Thanks, Dave. I'm actually using PHP/MySQL. How can I use the Show if Recordset
>not empty when the field is a part of a larger recordset? It's pulling all
>dates for a schedule, some of which are a special event. I always want the text
>of the special event to show, but make that text a link only if there is a link
>in the link field.
You could have:
<td>
<?php
if ( is_null($row_rsMyRecordset['ev_link...
LEGEND
,
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/m-p/708033#M146837
Nov 24, 2006
Nov 24, 2006
Copy link to clipboard
Copied
I think you could do something like this if using asp
vbscript,
<% If Not your_recordset_name.EOF Or Not your_recordset_name.BOF Then %>
<%=(your_recordset_name.Fields.Item("your_link_field").Value)%>
<% End If ' end Not your_recordset_name.EOF Or NOT
your_recordset_name.BOF %>
If not try the show region if recordset is not empty server behavior for
your lanuage.
Dave
"kllwca" <webforumsuser@macromedia.com> wrote in message
news:ek5g3m$e4n$1@forums.macromedia.com...
> I have a page with a repeating recordset, with one dynamic variable called
> Event that I would like to display as a link only if there is a link
entered in
> the link field. When I use data source and select the link field as my
link, it
> also shows all of the other Event entries, the ones with no data in the
link
> field, as links to the current page. Is there any way I can have the Event
show
> as a link only if the event link field contains data?
>
<% If Not your_recordset_name.EOF Or Not your_recordset_name.BOF Then %>
<%=(your_recordset_name.Fields.Item("your_link_field").Value)%>
<% End If ' end Not your_recordset_name.EOF Or NOT
your_recordset_name.BOF %>
If not try the show region if recordset is not empty server behavior for
your lanuage.
Dave
"kllwca" <webforumsuser@macromedia.com> wrote in message
news:ek5g3m$e4n$1@forums.macromedia.com...
> I have a page with a repeating recordset, with one dynamic variable called
> Event that I would like to display as a link only if there is a link
entered in
> the link field. When I use data source and select the link field as my
link, it
> also shows all of the other Event entries, the ones with no data in the
link
> field, as links to the current page. Is there any way I can have the Event
show
> as a link only if the event link field contains data?
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
webby7097
AUTHOR
Explorer
,
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/m-p/708034#M146838
Nov 25, 2006
Nov 25, 2006
Copy link to clipboard
Copied
Thanks, Dave. I'm actually using PHP/MySQL. How can I use the
Show if Recordset not empty when the field is a part of a larger
recordset? It's pulling all dates for a schedule, some of which are
a special event. I always want the text of the special event to
show, but make that text a link only if there is a link in the link
field.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/m-p/708035#M146839
Nov 25, 2006
Nov 25, 2006
Copy link to clipboard
Copied
On Sat, 25 Nov 2006 17:30:13 +0000 (UTC), "kllw"
<webforumsuser@macromedia.com> wrote:
>Thanks, Dave. I'm actually using PHP/MySQL. How can I use the Show if Recordset
>not empty when the field is a part of a larger recordset? It's pulling all
>dates for a schedule, some of which are a special event. I always want the text
>of the special event to show, but make that text a link only if there is a link
>in the link field.
You could have:
<td>
<?php
if ( is_null($row_rsMyRecordset['ev_link']) ) {
echo $row_rsMyRecordset['ev_text'];
} else {
echo "<a href=".$row_rsMy['ev_link'].">".$row_rsMy['ev_text']."</a>";
}
?>
</td>
--
Steve
steve at flyingtigerwebdesign dot com
<webforumsuser@macromedia.com> wrote:
>Thanks, Dave. I'm actually using PHP/MySQL. How can I use the Show if Recordset
>not empty when the field is a part of a larger recordset? It's pulling all
>dates for a schedule, some of which are a special event. I always want the text
>of the special event to show, but make that text a link only if there is a link
>in the link field.
You could have:
<td>
<?php
if ( is_null($row_rsMyRecordset['ev_link']) ) {
echo $row_rsMyRecordset['ev_text'];
} else {
echo "<a href=".$row_rsMy['ev_link'].">".$row_rsMy['ev_text']."</a>";
}
?>
</td>
--
Steve
steve at flyingtigerwebdesign dot com
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/m-p/708036#M146840
Nov 25, 2006
Nov 25, 2006
Copy link to clipboard
Copied
On Sun, 26 Nov 2006 02:23:24 +0800, Steve <me@here.com>
wrote:
>You could have:
Sorry, a typo crept in. I meant to write (where, of course,
$row_rsMyRecordset['event_text'] and $row_rsMyRecordset['event_link']
are whatever your query returns):
<?php
if ( is_null($row_rsMyRecordset['event_link']) ) {
echo $row_rsMyRecordset['event_text'];
} else {
echo "<a
href=".$row_rsMyRecordset['event_link'].">".$row_rsMyRecordset['event_text']."</a>";
}
?>
--
Steve
steve at flyingtigerwebdesign dot com
>You could have:
Sorry, a typo crept in. I meant to write (where, of course,
$row_rsMyRecordset['event_text'] and $row_rsMyRecordset['event_link']
are whatever your query returns):
<?php
if ( is_null($row_rsMyRecordset['event_link']) ) {
echo $row_rsMyRecordset['event_text'];
} else {
echo "<a
href=".$row_rsMyRecordset['event_link'].">".$row_rsMyRecordset['event_text']."</a>";
}
?>
--
Steve
steve at flyingtigerwebdesign dot com
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
webby7097
AUTHOR
Explorer
,
LATEST
/t5/dreamweaver-discussions/display-dynamic-link-only-if-not-null/m-p/708037#M146841
Nov 25, 2006
Nov 25, 2006
Copy link to clipboard
Copied
Excellent - that did the trick! Thanks much.
K
K
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

