Dusaro Posted December 31, 2011 Share Posted December 31, 2011 Well, I am not sure where to post this since it is using php and javascript. I am using OSFlvPlayer to stream the videos, the information for each video is in a mysql database. Using the $_GET php variable I am getting a value called id, I am then comparing the $id variable with the value called ID in the mysql database. The problem i am having is that it will not get the correct directory to get the videos, it is simply setting it as "/videos/.flv" instead of say "/videos/mario.flv" <?php //disabling cache header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past //getting id of video $id = $_GET[id]; // Connects to your Database mysql_connect("localhost", "user", "pass") or die(mysql_error()) ; mysql_select_db("database") or die(mysql_error()) ; //Retrieves data from MySQL $data = mysql_query("SELECT * FROM Videos WHERE ID= '$id'") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data Echo "<b>Name:</b> ".$info['Name'] . " <br>"; ?> <script src='AC_RunActiveContent.js' language='javascript'></script> <!-- saved from url=(0013)about:internet --> <script language='javascript'> AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '400', 'height', '325', 'src', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'allowScriptAccess', 'always', 'movie', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'FlashVars', 'movie=/videos/<?php $info["Name"] ?>.flv&btncolor=0x333333&accentcolor=0x31b8e9&txtcolor=0xdddddd&volume=30&autoload=on&autoplay=off&vTitle=<?php $info["Name"] ?>&showTitle=yes'); </script> <noscript> <object width='400' height='325' id='flvPlayer'> <param name='allowFullScreen' value='true'> <param name="allowScriptAccess" value="always"> <param name='movie' value='OSplayer.swf?movie=<?php $info["Name"] ?>.flv&btncolor=0x333333&accentcolor=0x31b8e9&txtcolor=0xdddddd&volume=30&autoload=on&autoplay=off&vTitle=<?php $info["Name"] ?>&showTitle=yes'> <embed src='OSplayer.swf?movie=/videos/<?php $info["Name"] ?>.flv&btncolor=0x333333&accentcolor=0x31b8e9&txtcolor=0xdddddd&volume=30&autoload=on&autoplay=off&vTitle=<?php $info["Name"] ?>&showTitle=yes' width='400' height='325' allowFullScreen='true' type='application/x-shockwave-flash' allowScriptAccess='always'> </object> </noscript><br/> <?php Echo "<b>Description:</b><br/> ".$info['Description']; } ?> Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/ Share on other sites More sharing options...
AyKay47 Posted December 31, 2011 Share Posted December 31, 2011 most likely your $id variable is blank, so your query will return a resource but no rows are grabbed, thus no values.. wrap your index in quotes. $id = $_GET['id']; Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302717 Share on other sites More sharing options...
Dusaro Posted December 31, 2011 Author Share Posted December 31, 2011 The Name and Description are returning values when it is echoed. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302741 Share on other sites More sharing options...
trq Posted December 31, 2011 Share Posted December 31, 2011 Your not echoing your data. <?php echo $info["Name"]; ?> Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302745 Share on other sites More sharing options...
AyKay47 Posted December 31, 2011 Share Posted December 31, 2011 Ah, in your script function you have movie=/videos/<?php $info["Name"]; ?>.flv Where it should be, movie=/videos/<?php echo $info["Name"]; ?>.flv same goes to the other similar code, you must echo the variables. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302747 Share on other sites More sharing options...
trq Posted December 31, 2011 Share Posted December 31, 2011 Well repeated AyKay47. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302759 Share on other sites More sharing options...
AyKay47 Posted December 31, 2011 Share Posted December 31, 2011 Quote Well repeated AyKay47. Yep, well it takes me so darn long to type anything on my iPad, there was no way that I was going to erase 10 minutes of writing. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302761 Share on other sites More sharing options...
trq Posted December 31, 2011 Share Posted December 31, 2011 There are these things called computers these days, you should try one. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302762 Share on other sites More sharing options...
AyKay47 Posted December 31, 2011 Share Posted December 31, 2011 Currently playing Starcraft 2 on it. Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302763 Share on other sites More sharing options...
Dusaro Posted December 31, 2011 Author Share Posted December 31, 2011 thanks guys. I didn't realise that Link to comment https://forums.phpfreaks.com/topic/254102-getting-from-mysql-and-streaming-video/#findComment-1302775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.