Research pls http://www.w3schools.com/php/php_mysql_select.asp
ehpratah 48 Posting Whiz in Training
You can try
$endDate='2014-04-11';
$startdate='2014-04-01';
$daydiff = floor( ( strtotime( $endDate ) - strtotime( $startdate ) ) / 86400);
echo $daydiff;
it will count the day difference between the 2 dates
Hi as JorgeM said you need a js for it to be done...my suggestion is
like
on page load
<html>
<head>
</head>
<body onload="window.print()">
<?php
DATA FROM DB
?>
</body>
</html>
or using an image or button
<html>
<head>
</head>
<body>
<?php
DATA FROM DB
?>
<img src="printer.png" width="28" height="28" onclick="window.print()" />
<input type="button" value="Print this page" onclick="printpage()">
</body>
</html>
hey i think this part of the code is wrong
<form action="index.php" method="post">
you must replace it with
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">