Home >Backend Development >PHP Tutorial >php 如何取得mysql中变量值?

php 如何取得mysql中变量值?

WBOY
WBOYOriginal
2016-06-06 20:20:261489browse

如题,例如sql:update table set col = col + 1 where id = 22 and @value := col;
php该如何得到value的值呢?

回复内容:

如题,例如sql:update table set col = col + 1 where id = 22 and @value := col;
php该如何得到value的值呢?

是否应该是 and col=@value ?确定一条记录后,更新对应的值

你可以执行一条sql的返回结果就能获取到变量的值

<code>select @value;</code>
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