from the manual:
mysql_query() sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier.
in your query you are trying to execute 2 statements:
1 - SET @num = -1;
2 - SELECT DATE_ADD('2015-01-01 19:30', interval @num := @num+1 week) AS start_date,
DATE_ADD( ADDTIME('2015-01-01 19:30', '01:30' ), interval @num week) AS end_date,
num.* FROM num
WHERE num.i IS NOT NULL
multiple statements are not supported by mysql_query.