Heh, actually i didnt try your query =) I just noticed that little thing with that echo. 🙂
I don't know if this helps you out, but here is one example:
For example take all from sometable
$SQL="SELECT * FROM sometable";
$rs=mysql_query($SQL);
$output=mysql_fetch_row($rs);
Now we have first line from query in var $output
Then we can print it with echo $output[0] (where 0 is first column and so on...)
But before you do anything like this, have you made connection to your database?
$db_bost="yourhost";
$db_user="username";
$db_pw="password";
mysql_connect( $db_host, $db_user, $db_pw );
mysql_select_db( $db_base );
This has to be done before any queries.