Why does the line with id #7 appear?

I have here, for example, id=3, and this code shows this line on the screen – Resource id #7, why?

Answer 1, authority 100%

Well, because mysql_queryreturns not data, but a resource identifier, in order to get data, use, for example,

while ($row = mysql_fetch_array($a, MYSQL_NUM)) {
    printf( $row[0]);