For the last inserted record see here
$result = mysql_query("SELECT * FROM mydata WHERE client='$client' ORDER BY id DESC LIMIT 0, 1");
$result = mysql_query("SELECT * FROM mydata WHERE client='$client' group by campaign ORDER BY id DESC");
 
															For the last inserted record see here
$result = mysql_query("SELECT * FROM mydata WHERE client='$client' ORDER BY id DESC LIMIT 0, 1");
$result = mysql_query("SELECT * FROM mydata WHERE client='$client' group by campaign ORDER BY id DESC");