Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/indem/phq/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/indem/phq/statistics.php

<?php
$tbl = 't_recruitment';
$rs = mysql_query("select count(pno) as no from $tbl", $link);
$o = mysql_fetch_object($rs);
$no = $o->no;
$rs = mysql_query("select count(pno) as fno,sex from $tbl group by sex having sex='L=h'", $link);
$o = mysql_fetch_object($rs);
$fno = $o->fno;
$mno = $no - $fno;

touch('statistics.html');
if(!$fp = fopen('statistics.html', 'w')) //tries to open a file for writing
die('Error on opening file!'); //terminates the execution of the script if it cannot open the file
//fclose($oldfp);
//fputs($fp, .Hello again from PHP!.);
fwrite($fp, '<b>Statistics</b><br>');
fwrite($fp, 'Present Strength: ' . $no . '<br>');
fwrite($fp, 'Police Men: ' . $no . '<br>');
fwrite($fp, 'Present Women: ' . $no . '<br>');



fclose($fp);
echo "Statistics.html file created";
?>
<!--
<b>Statistics:</b><br>
Present Strength: <?=$no?><br>
Police Men: <?=$mno?><br>
Police Women: <?=$fno?><br>
Retired: nnnnn<br>
-->