# \[Help\] NEXT & PREV button \[Please\]

**URL:** <https://forum.kirupa.com/t/help-next-prev-button-please/178005>\
**Category:** flash\
**Created:** [February 7, 2006, 3:06am UTC](https://forum.kirupa.com/t/help-next-prev-button-please/178005 "2006-02-07T03:06:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mindriders](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindriders/32/2140_2.png) [@Mindriders](https://forum.kirupa.com/u/Mindriders)\
**Post date:** [February 7, 2006, 3:06am UTC](https://forum.kirupa.com/t/help-next-prev-button-please/178005/1 "2006-02-07T03:06:31Z")

</div>

[COLOR=DarkRed]Dear fellaz… i had something trouble in my prev & next btns.  
shortly desc is… i wanna display the messages 1 page 1 messages. but how… oh… once again… the system is php + sql + flash…

[/COLOR] [COLOR=DarkRed]allright tis the code.

[/COLOR] [COLOR=DarkRed]for the next buttons :

```auto
on (release) {
    if(current.text == total.text) { return; }
    loadMyData(Number(current.text));
}

```

[/COLOR] [COLOR=DarkRed]for the prev buttons :

```auto
on (release) {

    loadMyData(Number(current.text))-1;
}

```

[/COLOR] [COLOR=DarkRed]and here’s the frame script…

```auto
// di frame 1
loadMyData = function(n){
     datanya = new LoadVars();
     datanya.startid = n;
     datanya.onLoad = function(){
      panggil();
    };
    datanya.sendAndLoad("gbdata.php",datanya,"POST");
}
panggil = function(){    
    name.text = datanya.name;
    email.text = datanya.email;
    url.text = datanya.url;
    msg.text = datanya.msg;
    total.text = datanya.total;
    current.text = datanya.current;
};
// load data pertama
loadMyData(0);

```

[/COLOR] [COLOR=DarkRed]  
and here’s the php script…

```auto
<?
include("dbconnect.php");

$qry = mysql_query("SELECT id FROM book");
$totalRec = mysql_num_rows($qry);

$getnews = mysql_query("SELECT * FROM book ORDER BY id LIMIT $_POST[startid], 1");
while($r=mysql_fetch_array($getnews)){
extract($r);
print("&name=$name");
print("&email=$email");
print("&url=$url");
print("&msg=$msg");
print("&total=$totalRec");
print("&current=$id");
}

?>

```

[/COLOR] [COLOR=DarkRed]The case is… **i cant back to the previous messages.**  
thanks for your attentions and sorry for my english 😃  
[/COLOR]
