Hey guys, I'm fairly new to php and so I need some help on some stuff that should be basic. I'm trying to implement the following code to grab the name of a video, that I have stored in a mysql database. The video name is in the same row as the variable $url. When I try to implement the code I get the following warning " Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource" And the warning refers to me to the line where I have put ####. This might seem like a rookie mistake but any help would be appreciated.
PHP Code:
<?php $url = ['www.mysite.com/examplevideo']; ?>
<?php $query = mysql_query("SELECT video_name FROM videos WHERE video_url = '$url' "); while ($row = mysql_fetch_assoc($query)) #### { $videoname = $row['video_name']; } ?>
|