i have homework to show database records one by one in order by clicking button "next" in one page. ive done the basic, to shows one record, but, i dont know the syntax for the next button function.
ive tried raw coding, but it doesnt work T.T.. and research everything tht might relevant, but still.. this is the code that ive done so far,
<?php
include "koneksi.php";
$query = mysqli_query($connection,"SELECT distinct * FROM buatsoal_db ORDER BY ID DESC");
$data = mysqli_fetch_array($query)
?>
<form method="post">
<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit'])){ ?>
<table width="637" border="0" cellspacing="1" cellpadding="2">
<tr>
<th width="297" scope="col"><?php echo $data["SOALTXT"];?></th>
<th width="215" scope="col"><?php echo $data["SOLUSI"];?></th>
<th width="109" scope="col">
<label>
<input name="next" type="submit" id="next" value="next">
</label>
</th>
</tr>
</table>
<?php } ?>
the ouput from this code is :
submit(buttn) (when cliked it shows:)
2x+3=9 next(button) (when clicked it should shows other record under it without deleting 2x+3=9, so it should be like this :)
please.. help me...
Aucun commentaire:
Enregistrer un commentaire