Jump to content

Script Help


sherlock

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.