0){//update }else{//insert $sql="insert into $table_name ("; $value="values("; foreach($data as $key => $val){ $sql.=$key.","; $value.="'".$val."'," } $sql=rtrim($sql,","); $value=rtrim($value,','); $sql=$sql.")".$value.")"; } exequery(TD::conn(),$sql); ?>