single quotes in SQL Query

后端 未结 5 2168
半阙折子戏
半阙折子戏 2020-12-20 10:26

Im writing a php script that is used to update a database but it is giving errors when i tries to run the query it returns an error along the lines of

You h         


        
5条回答
  •  温柔的废话
    2020-12-20 10:35

    Why are you putting a \" right at the end, this puts a " on to the end of your SQL but you don't have one at the start?

    Try this:

    mysql_query("UPDATE Videos SET Title=".$_POST['Title'].", Preacher=".$_POST['Preacher'].", Date=".$_POST['Date'].", Service=".$_POST['Service'].", File=".$_POST['File'].", Description=".$_POST['Description']."WHERE id=".$_GET['vid_id']) or die(mysql_error());
    

提交回复
热议问题