Sorry bout the confusion this is what I am asking. I am trying to send videos to an ftp server but I do not want the videos that already exist on the ftp to be re uploaded. Hence i need a way to tell the database to do that. What I have is below, made a change thanks to @neo but it still returns and invalid query.
<?php
$dest="/Tools";
$query = "SELECT videoid AS videoId FROM videos
WHERE channel = 62 AND videoid NOT IN (@videoId)";
$results = mysql_query($query);
$server=("ftp.//");
$connect=ftp_connect($server);
$login_result=ftp_login($connect,"","");
if(!(login_result)||!($connect))
{
$error;
}
else
{
echo "success";
}
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "
";
die($message);
}
while ($row = mysql_fetch_assoc($result)) {
// loop through every videoid returned, ftp each individually
$upload=ftp_put($connect,$dest,$row['videoid'],FTP_BINARY);
if (!upload)
{
echo "failed to upload $results
";
}
else{
echo "successfully uploaded $videoid";
}
ftp_close($connect);
}
mysql_free_result($result);
?>