Home  >  Article  >  Backend Development  >  There is a problem updating a sql statement.

There is a problem updating a sql statement.

WBOY
WBOYOriginal
2016-12-01 00:57:071063browse

UPDATEvideo SET 0='page_view',1=page_view+1 WHERE ( video_id = '94' )
Error after execution
There is a problem updating a sql statement.

The php program is:
Model('video')->editMbVideo(array('page_view',array('exp','page_view+1')),$live_id);
Written like this

Reply content:

UPDATEvideo SET 0='page_view',1=page_view+1 WHERE ( video_id = '94' )
Error after execution
There is a problem updating a sql statement.

The php program is:
Model('video')->editMbVideo(array('page_view',array('exp','page_view+1')),$live_id);
Written like this

<code>UPDATE video SET `page_view` = 0, `page_view` = `page_view` + 1 WHERE ( `video_id` = '94' );</code>
  1. Note that the column identifier is `` not '', see clearly;

  2. Update syntax:

<code>UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value</code>

update video set field name = field value, field name 1 = field value 1 where ......

According to your error message, it is a syntax error. The syntax of update is field name = value, not value = field name. Classmates, you should read more about SQL syntax

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn