Is there an easier way to do this as it is a bit truncated
$sql = mysql_query("SELECT something FROM somewhere WHERE something = somethingelse");
$rows = mysql_num_rows($sql);
if(isset($rows)) {
mysql_query("UPDATE something SET ('somethong' = 'somethingelse') WHERE this = that");
} else {
mysql_query("INSERT INTO something (this, that, theother) VALUES ('this', 'that', 'theother')");
}