Dear friends!
I am new in PHP and MYSQL.I am developing Library managment system.I am facing
problem in coding.
I want to calculate and update Fine of Library members on daily basis.
My Database contains two columns .1. Issue Date and Due Date.
I want to fine member at $2 per day after due date.
I don't understand how to write code for that.Kindly if someone help me and
write exact code.
I have two options
1.Wether librarian clcik on button to activate fine status of all members
2.Librarian open admin view and fine status are updated automatically.
Kindly suggest me and help me.blow is some code
Thanks !
<?php
$today=date('d'); //today
$date=date('y-m-d'); //date
[EMAIL PROTECTED]("select * from issue_items ") or die(mysql_error());
while($row=mysql_fetch_array($results))
{
$date2=$row['DUE_DATE']; //due date of item
$due_day=substr("$date2",-2); //day in due date
$diff=0;
$diff=$today-$due_day;
if($diff<0) //if difference is (-ve) shows that month has changed
{
$diff=31+($diff);
}
[EMAIL PROTECTED]("update issue_items SET FINE=2*$diff ") or
die(mysql_error());
}
?>
---------------------------------
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
[Non-text portions of this message have been removed]
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/