A good idea for debugging is this:
Write each SQL statement on a new line:
<?php
$query = "SELECT
Id,
Time,
Venue
FROM `table_name`
WHERE name = '$name'";
$result = mysql_query($query);
This way, when you get the error message, you can now get a line number that corresponds to the query line number. Ingenious isn't it? I got it off of the thread on here about tips for debugging.
Also, check your code above the query. You may have missed something and PHP is only catching it then.
~Brett
EDIT
If that's a direct copy & paste, you're missing your closing quote.