How can i get the number of affected rows in drupal 7? db_affected_rows which i was used in d6 is not working in d7. It shows an error
$bool = db_query("SELECT * FROM {template_config} WHERE user_role = ':d'",array(':d'=> $id));
$num = db_affected_rows();
if ($num != 0) {
$result = db_fetch_array($bool);
$custom_theme = $result['theme_name'];
}
i want to check if there is any affected rows.db_num_rows also is not working in d7
How can i do this in d7?