Abstracting the update method. how can i iterate though the array???
Hello..
i have this problem.. im doing some kind of late static binding. im really a new to this and don't know how to solve this problem. please help me to solve it...
What i want to do is instead of using static:: $arr[0].",".static:: $arr[1] i want to iterate though the array.. i tried using a foreach loop but it doesn't work.. i don't understand why.. i will really appreciate if someone demonstrate a code to do this in a better way.
this is my code.
<?php
class MainModel {
public static function create($custArray){
global $connection;
$query="INSERT INTO ".static:: $tblname."(";
$query.=static:: $arr[0].",".static:: $arr[1];
$query.=") VALUES ('".$custArray['name']."','".$custArray['details']."')";
Design patterns of the classes, methods, variables are always dependent upon the rules of concepts like abstract, static. If we do follow the rule of the abstract class and if we do follow the rule of the static keywords, all design patterns should work fine.