Jump to content

Trying to load youtube via link that is inside my Data Base through PHP


immunity

Recommended Posts

hi i try to create a youtube player window in my page via php (a field in the data contains the link)

 

althought  $row return the correct link  it dont create me the Youtube player window

my code:

<?php

 

$con = mysql_connect("localhost","******","*****");

if (!$con)

  {

  echo "<img src=\"Design/topmoviefault.bmp\" />";

  }

  mysql_select_db("labdb2_19", $con);

  $result = mysql_query('Select * from movie , top_movie where movie.title = top_movie.title');

  while ($row = mysql_fetch_array($result))

  {

echo $row['youtube'];

echo "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"".$row['youtube']."\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"".$row['youtube']."\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>";

}

?>

 

 

my results :( :http://195.251.111.53/~labdb219/test67.php

 

anyone knows why is happening this ? how i could correct this fault ?

Put:

extract($row);

 

after:

while ($row = mysql_fetch_array($result))

 

Thanks for Reply !

Did it but no result again :(    (sorry i didnt use |code| |code|)

My codee now is

<?php

$con = mysql_connect("localhost","labdb2_19","2004040");
if (!$con)
  {
  echo "<img src=\"Design/topmoviefault.bmp\" />";
  }
  mysql_select_db("labdb2_19", $con);
  $result = mysql_query('Select * from movie , top_movie where movie.title = top_movie.title');
  while ($row = mysql_fetch_array($result))
  {
[b]extract($row);[/b]
echo $row['youtube'];
echo "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"".$row['youtube']."\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"".$row['youtube']."\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>";
}
?>

and exist only in this post :P thought it would bold this part of code :P

 

my results : http://195.251.111.53/~labdb219/test67.php

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.