Monthly Archives: October 2008

Getting the next n birthdays from a table in SQL

If we have a table with a basic structure like this: ———- person ———- person_id name dob … ———- Let’s run a query with the results sorted by order of upcoming birthdays: SELECT *, IF(MONTH(`dob`) < MONTH(NOW()) || (MONTH(`dob`) = … Continue reading

Posted in Programming, SQL | Tagged , , , | 1 Comment

Number of Selected Items in a Multiple Select Box with jQuery

With the html: <select name=”my_list” multiple=”multiple”> <option value=”one”>1</option> <option value=”two”>2</option> <option value=”three”>3</option> <option value=”four”>4</option> <option value=”five”>5</option> </select> One way to find the number of options selected: $(“select[name='my_list']>option:selected”).length

Posted in jquery, Programming | Tagged , , | Leave a comment