您的SQL语法有错误; 查看corres手册[关闭]

 <input type="hidden" name="id<?php echo $rrows['id']; ?>" id="id<?php echo $rrows['id']; ?>" value="<?php echo $rrows['id']; ?>">
                oponent1: <input name="oponent1<?php echo $rrows['id']; ?>" id="oponent1<?php echo $rrows['id']; ?>" type="text" size="30" value="<?php echo $rrows['oponent1']; ?>" >
                oponent2:<input id="oponent2<?php echo $rrows['id']; ?>" name="oponent2<?php echo $rrows['id']; ?>" type="text" size="30" value="<?php echo $rrows['oponent2']; ?>" >
                votes1: <input id="votes1<?php echo $rrows['id']; ?>" name="votes1<?php echo $rrows['id']; ?>" type="text" size="5" value="<?php echo $rrows['votes1']; ?>" >
                votes2: <input id="votes2<?php echo $rrows['id']; ?>" name="votes2<?php echo $rrows['id']; ?>" type="text" size="5" value="<?php echo $rrows['votes2']; ?>" >
                <br><br>


                video1: <input id="video1<?php echo $rrows['id']; ?>" name="video1<?php echo $rrows['id']; ?>" type="text" size="30" value="<?php echo $rrows['video1']; ?>" >
                video2: <input id="video2<?php echo $rrows['id']; ?>" name="video2<?php echo $rrows['id']; ?>" type="text" size="30" value="<?php echo $rrows['video2']; ?>" >
                ids: <input id="ids<?php echo $rrows['id']; ?>" name="ids<?php echo $rrows['id']; ?>" type="text" size="30" value="<?php echo $rrows['id']; ?>" >




                            <input name="doSave" type="button" id="doSave" value="Save" 
                onclick='$.get("do_video.php",{ cmd: "edit", votes2:$("input#votes2<?php echo $rrows['id']; ?>").val(),video1:$("input#video1<?php echo $rrows['id']; ?>").val(),video2:$("input#video2<?php echo $rrows['id']; ?>").val(),oponent1:$("input#oponent1<?php echo $rrows['id']; ?>").val(),oponent2:$("input#oponent2<?php echo $rrows['id']; ?>").val(),votes1: $("input#votes1<?php echo $rrows['id']; ?>").val(),id: $("input#id<?php echo $rrows['id']; ?>").val() } ,function(data){ $("#msg<?php echo $rrows['id']; ?>").html(data); });'> 

do_video.php

<?php 
include 'dbc.php';
session_start();
if(!checkAdmin()) {
header("Location: login.php");
exit();
}

$ret = $_SERVER['HTTP_REFERER'];

foreach($_GET as $key => $value) {
    $get[$key] = filter($value);
}

if($get['cmd'] == 'edit')
{
/* Now update user data*/   
mysql_query("
update videovote set  
`oponent1`='$get[oponent1]', 
`oponent2`='$get[oponent2]', 
`votes1`='$get[votes1]', 
`votes2`='$get[votes2]',
`video1`='$get[video1]'
`video2`='$get[video2]'
where `id`='$get[ids]'") or die(mysql_error());
//header("Location: $ret"); 

echo "changes done";
exit();
}
?>

showing error

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 'video2='http://www.youtube/watch?NR=1&v=7zp1TbLFPp8&feature=endscreen'' at line 7

help please

You have a missing comma after

`video1`='$get[video1]'

in your mysql_query line.

Change your mysql_query line to:

/* Now update user data*/   
mysql_query("
update videovote set  
`oponent1`='$get[oponent1]', 
`oponent2`='$get[oponent2]', 
`votes1`='$get[votes1]', 
`votes2`='$get[votes2]',
`video1`='$get[video1]',
`video2`='$get[video2]'
where `id`='$get[ids]'") or die(mysql_error());

The comma is missing in the line

`video1`='$get[video1]'

You forgot to add a comma (,) between $get[video1]' & '$get[video2]'.

Correct code:

    mysql_query(" update videovote set   `oponent1`='$get[oponent1]', 
    `oponent2`='$get[oponent2]',  `votes1`='$get[votes1]', 
    `votes2`='$get[votes2]', `video1`='$get[video1]',
    `video2`='$get[video2]' 
     where `id`='$get[ids]'") or
    die(mysql_error());