Newbies azreal Posted November 11, 2004 Newbies Posted November 11, 2004 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 !!
kfutter Posted November 11, 2004 Posted November 11, 2004 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
Newbies azreal Posted November 12, 2004 Author Newbies Posted November 12, 2004 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 !!
Recommended Posts
This topic is 7654 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now