Question: How can I add a class or ID to a Google Maps API V3 marker? I want to be able to access the markers using jQuery.

EDIT: Hi clarkf, thanks for the response. Using Firebug I'm not able to see those classes when inspecting my map but I did notice there are two divs. One for the icon and one for the button.

What I am trying to do is:
I have a list of lost pets displayed on the site, they are also displayed on the map. Each pet in the list has a unique ID, and I want the ones on the map to mirror this ID using a class as ID's need to be unique and there might be several points per pet. So I'm looking for a way of adding a class to a map marker. This way when a user selects a lost pet from the list it'll highlight it on the map or vice-versa.

Thanks

Ric

Answer: 
mysql\_num\_rows() tells you the number of rows returned by the database query. There is always a one row return in your case because there is always one a sum. The sum may be 0 of course.

It may be a good idea to test your query in the mysql query browser. Perhaps you are looking for something like this?

```
SELECT name, SUM(students_money) AS sum_money 
FROM students_table
GROUP BY name;

```

This will group the sums on a per name basis. To skip 0 sums you can add this:

```
HAVING sum_money > 0;

```
`SUM()` is an aggregate function. It takes all the rows that are returned for a group and adds them up.

Since you do not have a `GROUP BY` clause, it is adding up the values of all rows, even if there are none. It is then returning the total as a single row, so there should only be 1 row.

If you clarify what you want returned, I can try to help you write a statement to return it.