Can anyone explain why I am getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\html\video_player.php on line 35
The aim of the code is to display a video passed from another page which works perfectly well.
I've recently added the table at the end which should display a link when the video name (replacing the underscores between words with spaces and removing the file extension) matches the text in a field call title in a table.
Please help. Thank you.
<?php
$video = $_GET['video'];
$file_name = str_replace('_',' ',$video);
$file_name_no_ext = substr($file_name, 0, strrpos($file_name, '.'));
?>
<html>
<head>
<title>Videos</title>
<script src="flowplayer/example/flowplayer-3.1.4.min.js"></script>
</head>
<body>
<a
href="includes/videos/<?php echo($video); ?>"
style="display:block;width:425px;height:300px;"
id="player">
</a>
<script language="JavaScript">
flowplayer("player", "flowplayer/flowplayer-3.1.5.swf");
</script>
<table>
<tr>
<td align="center">View Instructions</td>
</tr>
<tr>
<td>
<table border="1">
<?php
require_once ('../mysql_connect.php'); // Connect to the database.
$order = "SELECT * FROM uploaded_instructions WHERE title=$file_name_no_ext";
$result = mysql_query($order);
while ($row=mysql_fetch_array($result)){
echo ("<a href=view_instructions.php?instructions_id=$row[instructions_id]> $row[title] </a><br />");} // <tr><td>$row[title]</td>
?>
</table>
</td>
</tr>
</table>
</body>
</html>