mysql: get affected row record after update -


i use 2 sql queries row record after update this, example:

step 1: update point user test@gmail.com

$sql = "update user set point=point-:point email=:email"; $result = $conn->prepare($sql); $result->bindvalue(':point', 2); $result->bindvalue(':email', 'test@gmail.com'); $result->execute(); 

step 2: have use sql query row['point'] after updated

$sql = "select point user email=:email"; $result = $conn->prepare($sql); $result->bindvalue(':email', 'test@gmail.com'); $result->execute(); $row = $result->fetch(pdo::fetch_assoc); echo $row['point']; 

so, question is, ther shortcut this? such 1 single query achieve this?

many thanks


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -