Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to create a simple PHP web system to “view”, “add”, “edit” and “delete” loan applications. The problem is during add new loan records to the system because i need to calculate formula for calculating "home loan" installment amount
The formula :
amount and duration is fetch during user fill up the form
Question : How i do mathematical operation to calculate installment amount from what user fill in the form to insert in mysql database? Thanks
Hope this helps.
<?php
$interest=0.5;
$amt=$_POST['amount'];
$duration=$_POST['duration']; // duration is in months
$intamt=pow((1+$interest),$duration);
$intamt2=pow((1+$interest),($duration-1));
$installment=($amt*0.5*$intamt)/$intamt2;
echo $installment;
?>
Check the working example here(http://codepad.org/Fw3wbsUP)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to create something like this:
I've been able to create it statically, just type int everything fixed in the code. I want to have it done dynamically, I've built the database which consists of all the data I need to have in this table.
But what I can't figure out how to achieve is the first two rows (Day and Date). Other than that, I can fill all from the data base (Group Members and data associated with.
Can someone direct me on how to achieve first two rows? or should I also set them with the data in the database?
EDIT
I need at least how to convert the day (1-Nov) to day. I will use current year (2013) or next year (2014) for now.
You may usefull following links. you can start from here and then can analyse there codes.
link 1 link 2
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a form where 2 users can transfer funds to each other.
Here is my code
$accountfrom=$_POST[accountfrom];
$accountto=$_POST[accountto];
$amount=$_POST[amount];
$result = mysql_query("UPDATE member
SET balance = IF(personID = $accountfrom, balance-$amount, balance+$amount)
WHERE personID IN ($accountfrom, $accountto)")
or die(mysql_error());
However if the user only has a balance of £10, this allows them to still trasfer more than they have available. Is there a way to stop this?
(the balance is stored in field named balance)
You need to query for available funds first. Then you check against the required funds and decide to update or not.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to add a page in my website by which I want conduct online exams. I want that my page is activate for 3 hours only. After 3 hours the page will submit itself as happens in online exams. Can any one give me any script how to make my page time constraint?
$time = date('Y-m-d H:i:s');
extract the hour from the date and do this
if ($hour > 10800){ // 10800 which is equal to 3 hours in seconds.
submit the exam
}
don't rely on javascript to set the time because the javascript may be disabled.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How Can I write a PHP script or MySQL script to do a repetitive task after a period of time? One example of this could be to delete the top row of a specific table in the database every 120 seconds.
Use EVENTS
CREATE EVENT delete_top_event
ON SCHEDULE
EVERY 2 MINUTE
DO
DELETE FROM your_table order by some_column desc limit 1;
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to create a Feedback form for my website with rating system, which will then display the monthly average rating to a separate page as a graph.
I do have a little concept. But It's lacking something. I know how to create a feedback form. But I am confused on how to save it in Mysql. I mean do I need to calculate the average rating before saving it to mysql or when calling from the graphs page.
Please help me with concept or example.
Thanks.
You will have a form, where the user will put all the rating and the info.
When the user press the "Send" button you will execute a PHP code, this script will take the value of the form, and insert them inside a database, with the current year / month.
When you will go on the page that will show the rating you will execute a php code that will take all the rating in the current year/month from the database , sum them, and do the average calculation. Then you will show the value.