AutoExecute UPDATE with ADODB
Login or Register to Bookmark this snippet
An alternative way of updating a table using ADODB, utilising the AutoExecute function. Makes the code a bit tidier.
<?php
$record['lot_number'] = $_POST['lot_number'];
$record['description'] =
stripslashes($_POST['description']);
$update_id = 'animal_id = ' . $_POST['animal_id'];
$result = $db->AutoExecute('table_name', $record, 'UPDATE', $update_id);
if ($result === false) {
echo 'Error updating: '.
$db->
ErrorMsg();
} else {
}
?>
Added by JC on 14th November, 2007
There are no comments about this snippet.
You must be registered and logged in to post a comment.
Login here to post a comment