November 11, 200421 yr Newbies hi there !! I have a problem with AddDBParam('-lop_end','or'). Can anybody give me some piece of code. I'm doing that in this way: //version 1 for($i=0; $i<count($field_value); $i++){ $this->query->AddDBParam('-lop','or'); $this->query->AddDBParam($filed_name[$i],$field_value[$i]); } $data = $this->query->FMFind(); //version 2 $this->query->AddDBParam('-lop','or'); for($i=0; $i<count($field_value); $i++){ $this->query->AddDBParam($filed_name[$i],$field_value[$i]); } $data = $this->query->FMFind(); but it's doesn't work : thanx for any help !!
November 11, 200421 yr I'm not sure if this is your actual problem as it may just be a typo with your post, but you have a syntax error in your 'for' loop. You have a variable $filed_name that I'm assuming should be $field_name. You don't show in your code where this variable has been set or what its value is. Cheers, Kevin Futter
November 12, 200421 yr Author Newbies i know that name of variable is different, but it's not a problem...I created class which i'm using to add/update/delete records from different layouts. I will show you whole function: //code function getInfo($field_name, $field_value, $sortfield='', $sort_type='', $operator=''){ unset($this->vars); $this->vars = array(); if(!empty($sortfield)){ $this->query->AddSortParam($sortfield,$sort_type); } $this->query->AddDBParam('-lop','or'); for($z=0; $z<count($field_name); $z++){ $this->query->AddDBParam($field_name[$z],$field_value[$z]); } $data = $this->query->FMFind(); if($data['errorCode']!=0) { return 0; } $j=0; foreach ($data['data'] as $key => $instanceData){ // numbers of rows in database for($i=0; $i<count($this->fieldNames); $i++){ // numbers of fields $this->vars[$this->fieldNames[$i]][$j] = $instanceData[$this->fieldNames[$i]][0]; } $j++; } return 1; } //end basically $field_name and $field_value are arrays thanks for any help !!
Create an account or sign in to comment