Update query with returning
#1
I want to do like that


$sql="UPDATE mybb_users SET ".$campo."='".$partes[3]."' WHERE uid='".$partes[1]."' RETURNING id AS afectados;";
 $respuesta=$db->query($sql);
$afectados=$db->fetch_field($respuesta, 'afectados');


but with this:

$update_array = array(
$campo => $info[4]
);
$r=$db->update_query('users', $update_array, "uid = {$nombre_usuario['uid']}","RETURNING id AS afectados;");

$afectados=$db->fetch_field($r, 'afectados');

Is possible?
Reply


Messages In This Thread
Update query with returning - by Augustino7 - 2016-12-31, 08:23 PM
RE: Update query with returning - by Matt - 2016-12-31, 08:31 PM
RE: Update query with returning - by Augustino7 - 2016-12-31, 08:43 PM
RE: Update query with returning - by Matt - 2016-12-31, 08:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)