HighDots Forums  

Code help needed

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Code help needed in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RT
 
Posts: n/a

Default Code help needed - 08-30-2004 , 09:20 AM






Hello;

I'm trying to create a updates pages that I can move either to the previous
record or the next record within a recordset without having to return to the
repeating list of records after each up date.

Assuming I have done the recordset correctly, which I have and the update
records command as well here is the code I'm trying to use:

<?php
$prev = ''; $next = '';
$result = mysql_query("SELECT id FROM affiliates WHERE id <
$row_rsaffiliate[id] ORDER BY id DESC");
if ($result)
{
$row = mysql_fetch_row($result);
$prev = $row[0];
mysql_free_result($result);
}
$result = mysql_query("SELECT id FROM affiliates WHERE id <
$row_rsaffiliate[id] ORDER BY id ASC");
if ($result)
{
$row = mysql_fetch_row($result);
$next = $row[0];
mysql_free_result($result);
}
?>

<?php
if ($prev) echo '<a
href="../affiliateeditform.php?id=' . $prev . '"><b>&lt;&lt;Prev</b></a>';
else echo '<b>&lt;&lt;Prev</b>';
?>
<?php
if ($next) echo '<a
href="../affiliateeditform.php?id=' . $next . '"><b>Next&gt;&gt;</b></a>';
else echo '<b>Next&gt;&gt;</b>';
?>
This code works in another page I copied it from but in the page I paste it
into so that leads me to believe I'm missing something.

In the New page the Prev and Next labels show up as text and not links
between the records as I want.

Any thoughts anyone.

Thanks

RT



Reply With Quote
  #2  
Old   
RT
 
Posts: n/a

Default Re: Code help needed 2nd request - Anyone ? - 09-01-2004 , 01:13 PM






On 8/30/04 9:20 AM, in article BD58A1E6.1B454%robertth (AT) comcast (DOT) net, "RT"
<robertth (AT) comcast (DOT) net> wrote:

Quote:
Hello;

I'm trying to create a updates pages that I can move either to the previous
record or the next record within a recordset without having to return to the
repeating list of records after each up date.

Assuming I have done the recordset correctly, which I have and the update
records command as well here is the code I'm trying to use:

?php
$prev = ''; $next = '';
$result = mysql_query("SELECT id FROM affiliates WHERE id
$row_rsaffiliate[id] ORDER BY id DESC");
if ($result)
{
$row = mysql_fetch_row($result);
$prev = $row[0];
mysql_free_result($result);
}
$result = mysql_query("SELECT id FROM affiliates WHERE id
$row_rsaffiliate[id] ORDER BY id ASC");
if ($result)
{
$row = mysql_fetch_row($result);
$next = $row[0];
mysql_free_result($result);
}
?

?php
if ($prev) echo '<a
href="../affiliateeditform.php?id=' . $prev . '"><b>&lt;&lt;Prev</b></a>';
else echo '<b>&lt;&lt;Prev</b>';
?
?php
if ($next) echo '<a
href="../affiliateeditform.php?id=' . $next . '"><b>Next>></b></a>';
else echo '<b>Next>></b>';
?
This code works in another page I copied it from but in the page I paste it
into so that leads me to believe I'm missing something.

In the New page the Prev and Next labels show up as text and not links
between the records as I want.

Any thoughts anyone.

Thanks

RT




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.