Relative Content

Tag Archive for phpmysql

Query to fetch datas where current date is greater than another field plus one year

I am working on a php project with mysql. In the database i have a table that store users data and in these data there is the medical certificate. When i record the medical certificate i insert the release date (I know that it is valid for one year from this date).
Now i would like to fetch from the database all the users that have the medical certificate outdated. To do this, i use this query but it returns wrong result.. What am I doing wrong? what am I missing? I use DATE_ADD to add one year to medical certificate inside the query:

Trouble with PHP coding

I have trouble with the final Lesson 29 from the book Learn PHP, MySQL and JavaScript. This time I’m using ServBay and when I try to open the site folder I got the error :

Ranking students grades Mysqli

i have an exams table with students scores for each subject in the same table. the problem is that i want to have a rank for each subject of a student. for example what is the students rank in english. the problem is that the ranking seems to be done by comparing all the students subjects. therefore not giving an accurate result.