RE: [PHP] Doubts concerning a general Insert method

2009-07-14 Thread MEM
Ok... according to the above posts, I've started to create my generic CRUD class however, I'm wondering: Any of you have already used a DAO design pattern in conjunction with a CRUD generic class? Know that I'm trying to create a generic CRUD class on a DAO Design pattern, it seems that it mak

RE: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread MEM
Nice. :-) Thanks a lot Stuart for your time and explanations. Now that I have understand, I will try to move on, and understand how can we introduce bindParams on it: For a recall, here is the original class: > public function dbInsert($table, $values) { > >$this->conn(); > >$fi

Re: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread Stuart
2009/7/13 MEM : > >>     $values[0] will give you the first element of $values, namely >> array('animal_name'=>'bruce', 'animal_type'=>'dingo'). >> >>     array_keys will return an array containing the keys from the >> passed array, so in this case you'll get array('animal_name', >> 'animal_type').

RE: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread MEM
> $values[0] will give you the first element of $values, namely > array('animal_name'=>'bruce', 'animal_type'=>'dingo'). > > array_keys will return an array containing the keys from the > passed array, so in this case you'll get array('animal_name', > 'animal_type'). > So... since $value

Re: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread Stuart
2009/7/13 MEM : > Hello, I'm trying to understand a general CRUD class that I've seen here: > http://www.phpro.org/classes/PDO-CRUD.html > > I'm learning PHP and I have some doubts on this method to generally insert > data into DB. The class name is crud and here is the method: > > public function