display IF a value exists in the database

Ok, I’ve got a site with products and some of them have a link to a video in the database. What I want to do is IF that field in the database is NOT null, then display the video player. I’m not sure how to write that?

This is the part that I want to only display if there is a movie title in the database:
// Query table and get video file names. //
$sql = “SELECT products2Name,products2Movie FROM products2 WHERE products2ModelID=$subcat”;
$result = mysql_query($sql);

			echo "<div id=\"container\">";
			echo "<div id=\"video_obj_container\"></div>";
			$sw = 0;
			echo "<select id='vf' name='vf' onchange='display_video_obj(this.value)'>";
			 while($vf = mysql_fetch_assoc($result))
			 {
			  echo "<option value='".$path.$vf[products2Movie]."'>".$vf[products2Name]."</option>";
			  }
			 echo "</select>";
			 mysql_free_result($result1);
			 mysql_close();
			 echo "</div>";

Thank you for any help!

Sponsor our Newsletter | Privacy Policy | Terms of Service