forked from djoudi/underQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
005_update_from_array.php example was added
- Loading branch information
Abdullah Eid
committed
Dec 10, 2012
1 parent
1bcb26a
commit 819a8cf
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
?> |