I'm having problems figuring out how to put two arrays in to a single string while running them through a for loop any help would be appreciated. I'm creating of course a mysql class of functions to use with my website. If you need more info let me know but I think this is a pretty straight forward approach.
//Update Database Record Function
function Update(){
$this->call = "UPDATE ".$this->table." SET ";
if(is_array($this->fields)){ //Checks to find out if there are multiple fields that need update
$this->total = count($this->fields); //Counts the number of fields
for($i=0; $i <= $this->total; $i++){
$this->set = $this->fields[$i]."=".$this->field_val[$i].",".$this->set; //PROBLEM AREA
}
} else {
$this->set = $this->fields ."=". $this->field_val;
}
$this->sql = $this->call."".$this->set." ".$this->WHERE_statement." ".$this->table_var."="$this->where;
mysql_free_result($this->trustinmetcg);
}