Jump to content
Sign in to follow this  

Incorporação youtube com php

Recommended Posts



Pela primeira vez estou a tentar usar videos do youtube + php. Tenho os links guardados numa base de dados. vejamos o código:

				if (!$db){
					die('Não foi possível conectar á Base de Dados' . mysql_error());
			$query="SELECT `video_id` FROM `youtube`";
			$result=mysql_query($query,$db) or die ("bad operation" . mysql_error());
			$nreg = mysql_affected_rows(); //basicamente é o numero de id
			$id = 1;
			while($id <= $nreg){
				$query="SELECT * FROM `youtube` WHERE `video_id`='$id'"; //&& `galeria`='principal'
				$result=mysql_query($query,$db) or die ("bad operation" . mysql_error());
				$id +=1;
				echo '<iframe width="480" height="390" src="'.$link.'" frameborder="1" allowfullscreen></iframe>';
			mysql_close($db); ?>

Ele imprime as iframe correctas, com o código correcto, só que não funciona, fica assim:


Alguém tem alguma sugestão?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.