First off you need to fetch the resulting row from the resultset of the query. For that you can use mysql_fetch_row . Now that you have the fetched row you can access the retrieved value and echo it into the src. For example First off you need to fetch the resulting row from the resultset of the query. For that you can use mysql_fetch_row . Now that you have the fetched row you can access the retrieved value and echo it into the src. ....