Viewing file: certificateno.php (1.02 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
$link = mysqli_connect("localhost",'itce_user','rb!itc838',"itce_data"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Attempt select query execution $sql = "select * from certificate where CertificateNo BETWEEN 100 AND 1011000 order by CertificateNo"; if($result = mysqli_query($link, $sql)) { if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_array($result)) { $certificatnonew=$row['CertificateNo'];
$count++ ; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "Record Not found"; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
$serialno=$certificatnonew; if (preg_match("/ITCC/", $serialno)) { $genserialno=substr($serialno,4); } else { $accountnew=$serialno+1; }
$accountnew=(ITCC0.$accountnew);
// Close connection mysqli_close($link); ?>
|