I want to get or fetch maximum date from a table grouped by party_id.
To do this I tried:
$check = mysql_fetch_array(mysql_query("select max(fixed_date) as f from case_proceeding group by party_id where party_id='$row[party_id]'"));
After that, I want to print that maximum date like this:
echo $check['f'];
but it does not work. I think there is a mistake in the mysql_query.
try,
GROUP BY(which should come afterWHEREclause) isn’t needed here since you already filtered fromWHEREbut your quesry is vulnerable with
SQL Injection, please read the article below to protect against it