sherlock Posted October 6, 2008 Share Posted October 6, 2008 Hello i am developin a yutube kind script to simply get videos from youtube to my site. It works fine when i run it on my computer but doesnt work when i uplaod it to my host. Problem with the query: SELECT id, title, link FROM `videos_` WHERE id = You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Here is the code require ('config.php'); $conn = mysql_connect($dbhost,$dbuser,$dbpass,$dbname); $db = mysql_select_db("$dbname"); $query = "SELECT id, title, link FROM `videos_` WHERE id =$id"; $result = mysql_query($query) or die("Problem with the query: $query <br>" . mysql_error()); $num = mysql_num_rows($result); $row = mysql_fetch_array ($result, MYSQL_NUM); $title = $row['1']; $link = $row['2']; echo ' <p>Video Title : '.$title.' '.$link.'</p> <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'.$link.'"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'.$link.'" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object> ' ; any help will be much appreciated thanks Link to comment https://forums.phpfreaks.com/topic/127205-script-help/ Share on other sites More sharing options...
ratcateme Posted October 6, 2008 Share Posted October 6, 2008 $id is not defined should there be a line similar to $id = $_GET['id']; somewhere in your code? Scott. Link to comment https://forums.phpfreaks.com/topic/127205-script-help/#findComment-657977 Share on other sites More sharing options...
sherlock Posted October 6, 2008 Author Share Posted October 6, 2008 Thanks Bro It worked.Thanks for ur help Link to comment https://forums.phpfreaks.com/topic/127205-script-help/#findComment-658022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.