Viewing file: receipt.php (771 B) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$host="localhost"; // Host name $username="baserain_dba838"; // Mysql username $password="rb!bsa838mau"; // Mysql password $db_name="baserain_db838"; // Database name $tbl_name="new_acc"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");
// Retrieve data from database $sql="SELECT MAX(id), receipt_no FROM $tbl_name"; $result=mysql_query($sql);
// Start looping rows in mysql database. while($rows=mysql_fetch_array($result)){ ?> <form action="" method="post"> <?php $receiptnew=$rows['receipt_no']+1; ?> </form>
<? // close while loop }
// close connection mysql_close(); ?>
|