<?php

function simpleinsert($tablename, $fieldArray, $valueArray)
{ global $dbConnection;
		$a=1;
		$field="";
		$fieldnum=count($fieldArray);
		foreach($fieldArray as $fieldname)
		{ $field.=$fieldname;
			if ($a<$fieldnum)
				{ $field.=", ";
						}
				$a++;
				}
		$b=1;
		$value="";
		$valuenum=count($valueArray);
		foreach($valueArray as $valuename)
		{ $value.="'".$valuename."'";
			if ($b<$valuenum)
				{ $value.=", ";
						}
				$b++;
				}
		$i_query="INSERT INTO ".$tablename." (".$field.") VALUES (".$value.")";
		$i_result=mysqli_query($dbConnection, $i_query);		
		if ($i_result)
		{ return true;
				}
		else
		{ return false;
				}		
		}

?>