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
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 have a table, codes, with 3 columns (code, email, sent).
How do I call on the first X number of rows of table codes and assign each individual code (in code column) a variable with ordered numbers? (ie $code1, $code2, $code3, $code4)
Now, I will be calling on a multiple of 10 rows (10 rows, 20 rows, 30 rows) at a time so I need to be able to call on these codes individually for other procedures.
Thanks so much for the help!
Try putting the results in an array. Then call on them by using $code['1'] or what ever you are looking for
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
What I'm trying to do is get some activities from an activity calendar that fall within the current week to create a widget that shows activities for the current week. Now how could I do such a thing with PHP/MySQL? Each database row has a date field.
This is the structure of the db table I'm working with:
I hope my question is clear and I hope someone will be able to help me out.
Use YEARWEEK() function: WHERE YEARWEEK(NOW()) = YEARWEEK(datum)
select foo, bar from mytable where STR_TO_DATE(datum, '%Y/%m/%d') > (CURDATE() - INTERVAL 7 DAYS);
EDIT: add string to date conversion as original field is a varchar.
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)
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.
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
In PHP, I would like to run a query that would delete every row in a database that had the ID of less than a figure.
The context I want to use it in, is running a PHP CRON job every 24 hours that will delete all rows with values in the 'time' column that are LESS THAN time();
Putting it in to another context: I want to run a query that will delete every row that has an ID of ~10.
Thanks
I imagine you are not very familiar with SQL. This is a simple delete statement:
delete from t
where id < 10;
This assumes that by "database", you really mean "table". It also makes some other assumptions about foreign key references in other tables. Because the question seems so basic, I am guessing these are not issues.
However, I would recommend that you study up a bit on databases if you are going to use them in your applications.