문제

Is it possible to update only one field out of two in sphinx sql or in PHP? for example the below is the index that I have

+-----------+---------+
| Field     | Type    |
+-----------+---------+
| id        | integer |
| article   | field   |
| notes     | field   |
| post_date | uint    |
| gid       | uint    |
+-----------+---------+

and then I'm inserting this

insert into artidx values (1, 'test article', 'note one', 1234,1);

Then this, which is updating "article" just fine but removing "notes",

replace into artidx (id, article) values (1, 'test article modified');
도움이 되었습니까?

해결책

No. Not possible.

To update a field, need to delete the whole record and re-insert it.

The REPLACE INTO command, just does this in one step.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top