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