Hi bbarbin, welcome to the boards, and welcome to your personal php adventure.
Different people have different ways to code this, so I am going to give you my personal way...
$imagequery = "SELECT image FROM productinfo WHERE product_id = '".$_GET['theproduct']."'";
Like I said, this would be how I would write it personally... Other people have other ways and will probably show you theirs as well. The key (as with any language) is to develop your style and code consistently within that framework, so you always know what you are doing...