| Current Path : /var/www/html/mmishra/indem/phq/admin/ |
| Current File : /var/www/html/mmishra/indem/phq/admin/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('../static/statistics.html');
if(!$fp = fopen('../static/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
//fputs($fp, .Hello again from PHP!.);
fwrite($fp, "<b>Statistics</b><br>\n");
fwrite($fp, 'Present Strength: ' . $no . "<br>\n");
fwrite($fp, 'Police Men: ' . $mno . "<br>\n");
fwrite($fp, 'Present Women: ' . $fno . "<br>\n");
fclose($fp);
include ('../static/statistics.html');
?>
<p>
Statistics.html file created in static directory