Viewing file: reg_roll.php (887 B) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php'; // Attempt select query execution $sql = "SELECT * FROM admission order by LENGTH(enrollment),enrollment"; if($result = mysqli_query($link, $sql)) { if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_array($result)) { $roll_no=$row['enrollment'];
} // Free result set mysqli_free_result($result); } else{ $roll_no='ITC00001'; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
$serialno=$roll_no; if (preg_match("/ITCE/", $serialno)) { $genserialno=substr($serialno,5);
} $newrollno=$genserialno+1;
$accountnew=('ITCE/000'.$newrollno);
// Close connection mysqli_close($link); ?>
|