Skip to content

Commit

Permalink
Setup the Basic Structure and Codes
Browse files Browse the repository at this point in the history
  • Loading branch information
akmnahid committed Mar 27, 2016
1 parent a51b4f7 commit e1c7c99
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# IntelliJ project files
.idea
*.iml

*.iml
8 changes: 1 addition & 7 deletions DatabaseObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,7 @@ public function save(){
else {
$sql = "Update `" . static::getTableName() . "` SET " . implode(',', $sql) . " WHERE `" . static::getPrimaryKey() . "`=" . (int)$this->{static::getPrimaryKey()};
}
// }
try{
//echo $sql.'<br>';

$stmt = static::getDbInstance()->prepare($sql);

foreach(static::getColumns() as $column){
Expand All @@ -255,10 +252,7 @@ public function save(){
}
$stmt->bindParam(":".$column,$this->{$column});
}
//echo "\n\n";
//$stmt->debugDumpParams();
//echo "\n\n";
//echo $stmt->queryString;

$stmt->execute();


Expand Down
3 changes: 2 additions & 1 deletion DbInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ public static function getColumns();
public static function getPrimaryKey();


}
}

3 changes: 3 additions & 0 deletions Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Expression
public $column=null;
private $quote = false;

/**
* constructor
*/
public function __construct($value,$column=null,$quote=false){
$this->value = $value;
$this->column = $column;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ License


GNU GPL


0 comments on commit e1c7c99

Please sign in to comment.