Skip to content

Commit

Permalink
005_update_from_array.php example was added
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdullah Eid committed Dec 10, 2012
1 parent 1bcb26a commit 819a8cf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/005_update_from_array.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
Table name : users
Fields : id - name - email - description
*/

require_once('underQL.php');

$the_array['id'] = 10;
$the_array['name'] = 'Abdullah';
$the_array['email'] = '[email protected]';
$the_array['description'] = 'Programmer';

$_('users'); // $_('table_name') this will create a new object named $table_name

// this will update ALL emails and descriptions to the above values
$users->_('update_from_array',$the_array);
// or you can yous it as :
// $users->_('update_from_array',$the_array,"put extra sql here like where");
// $users->_('update_from_array',$the_array,"WHERE $id = 10");
// NOTE : it is exactly works like $users->_('update'), but it is takes its values
// from array.

?>

0 comments on commit 819a8cf

Please sign in to comment.