PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table identity (id int, Device_id varchar(255)); insert into identity values (1, 'test');
Copy Clear
Copy Format Clear
<?php $conn = &$mysql; $Device_id = 'Device 1'; $id = 1; $sql = "UPDATE identity SET Device_id = ? WHERE id = ? "; $stmt = $mysqli->prepare($sql); $stmt->bind_param('si', $Device_id, $id); if ($stmt->execute()) { echo "Record updated successfully"; } else { echo "Error updating record: " . mysqli_error($conn); } $conn->close();
Show:  
Copy Clear