Page 4 of 4
Posted: Fri Feb 03, 2006 12:55 am
by nickman013
Now that I read all of the stuff that Jcart told me to do in his post, I am almost there.
Code: Select all
<?php
$username= "muot_video";
$password= "video";
$database= "muot_videos";
$connection = mysql_connect('localhost',$username,$password);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`id` '
: '`Fileame` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename` FROM `videos` '. $clause;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
echo '<EMBED SRC="/pages/videos/'.$row['fileName'].'" AUTOSTART=true></EMBED>';
?>
this is where I am at now.
I get a parse error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/muot/public_html/newsite/videos/play.php on line 19
Line 19
Code: Select all
<?php
$row = mysql_fetch_assoc($result);
Might have done it wrong but it is what I thought to do.
Posted: Fri Feb 03, 2006 1:00 am
by nickman013
I almost got it.
I am getting the video player now. But it is playing the video that is first on the list.
code as of now
Code: Select all
<?php
$username= "muot_video";
$password= "video";
$database= "muot_videos";
$connection = mysql_connect('localhost',$username,$password);
mysql_select_db($database);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`id` '
: '`Fileame` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename` FROM `videos` '. $clause;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
echo '<EMBED SRC="/pages/videos/'.$row['Filename'].'" AUTOSTART=true></EMBED>';
?>
Posted: Fri Feb 03, 2006 1:01 am
by John Cartwright
Code: Select all
<?php
$username= "muot_video";
$password= "video";
$database= "muot_videos";
$connection = mysql_connect('localhost',$username,$password);
mysql_select_db($database);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`id` '
: '`Fileame` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename`, `id` FROM `videos` '. $clause;
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) == 1) {
$row = mysql_fetch_assoc($result);
echo '<EMBED SRC="/pages/videos/'.$row['Filename'].'" AUTOSTART=true></EMBED>';
}
else {
while ($row = mysql_fetch_assoc($result)) {
echo '<a href="/play.php?id='.$row['id'].'">'.$row['FileName'].'</a> <br />';
}
}
Like I already told you to do..
but this is seriously the last time.. I just want to see this thread finish in the near future

Posted: Fri Feb 03, 2006 1:10 am
by nickman013
I just get a blank white page now.
Posted: Fri Feb 03, 2006 1:12 am
by John Cartwright
I edited it.. try now.
Posted: Fri Feb 03, 2006 1:13 am
by nickman013
Still white.
Posted: Fri Feb 03, 2006 1:16 am
by John Cartwright
post your code...
Posted: Fri Feb 03, 2006 1:17 am
by nickman013
Code: Select all
<?php
$username= "muot_video";
$password= "video";
$database= "muot_videos";
$connection = mysql_connect('localhost',$username,$password);
mysql_select_db($database);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`id` '
: '`Fileame` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename`, `id` FROM `videos` '. $clause;
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) == 1) {
$row = mysql_fetch_assoc($result);
echo '<EMBED SRC="/pages/videos/'.$row['Filename'].'" AUTOSTART=true></EMBED>';
}
else {
while ($row = mysql_fetch_assoc($result)) {
echo '<a href="/play.php?id='.$row['id'].'">'.$row['FileName'].'</a> <br />';
}
}
?>
Posted: Fri Feb 03, 2006 1:18 am
by John Cartwright
whats the source?
Posted: Fri Feb 03, 2006 1:20 am
by nickman013
the source for the video?
i am going to the link
http://www.mysite.com/play.php?id=4 and id 4 in my DB is a video with the file name.
Posted: Fri Feb 03, 2006 1:22 am
by John Cartwright
html source
if your in IE go to View -> Source
firefox go to View -> Page Source
Posted: Fri Feb 03, 2006 1:23 am
by nickman013
Code: Select all
<a href="/play.php?id=1"></a> <br /><a href="/play.php?id=2"></a> <br /><a href="/play.php?id=3"></a> <br /><a href="/play.php?id=4"></a> <br /><a href="/play.php?id=5"></a> <br /><a href="/play.php?id=6"></a> <br /><a href="/play.php?id=7"></a> <br /><a href="/play.php?id=8"></a> <br /><a href="/play.php?id=9"></a> <br /><a href="/play.php?id=10"></a> <br /><a href="/play.php?id=11"></a> <br /><a href="/play.php?id=12"></a> <br /><a href="/play.php?id=13"></a> <br /><a href="/play.php?id=14"></a> <br />
Posted: Fri Feb 03, 2006 1:25 am
by nickman013
the reason why the link has no name is because
should be
Posted: Fri Feb 03, 2006 1:36 am
by nickman013
This thread is busted. Jcart helped me on MSN and solved it in a jiffy.
Thank You everybody!
Posted: Fri Feb 03, 2006 1:42 am
by John Cartwright
Finally got around to doing my New Years resolution.. help someone out even though you have school work to do
Anyways, now that thats over, I can go back to being evil..