name; } /* $myfile = fopen($_SERVER['DOCUMENT_ROOT']."/temp_log/".uniqid('var_dump_').".txt", "w") or die("Unable to open file!"); fwrite($myfile, $intNumField."\n"); fwrite($myfile, $sql."\n"); fwrite($myfile, $col[0]."\n"); fclose($myfile); */ while ($obResult = mysqli_fetch_array($objQuery)) { $arrCol = array(); for ($i = 0; $i < $intNumField; $i++) { $data[$col[$i]] = $obResult[$i]; } array_push($resultArray, $data); } return $resultArray; } function query($string,$tabel,$where='1=1',$join=''){ global $link; db_connect(); $sql="SELECT $string FROM $tabel $join WHERE $where "; //echo $sql.'
'; $objQuery = mysqli_query($link, $sql); $resultArray =array(); $intNumField = mysqli_num_fields($objQuery); while ($objResult = mysqli_fetch_array($objQuery)) { $arrCol = array(); for ($i = 0; $i < $intNumField; $i++) { $data[mysqli_fetch_field_direct($objQuery, $i)->name] = $objResult[$i]; } array_push($resultArray, $data); } if ( strpos($table, 'amphur') !== false ) { $myfile = fopen($_SERVER['DOCUMENT_ROOT']."/temp_log/".uniqid('form_register_amphur_').".txt", "w") or die("Unable to open file!"); fwrite(strpos($string, 'amphur')."\n"); fwrite($myfile, $sql."\n"); fwrite($myfile, print_r($resultArray, true)."\n"); fclose($myfile); } return $resultArray; } function insertData($table,$data){ global $link; db_connect(); $fields=""; $values=""; $i=1; foreach($data as $key=>$val) { if($i!=1) { $fields.=", "; $values.=", "; } $fields.="$key"; $values.="'$val'"; $i++; } $sql = "INSERT INTO $table ($fields) VALUES ($values)"; // echo $sql.'

'; if(@mysqli_query($link, $sql)) { return true; } else {return false;} } function insertDataId($table,$data){ global $link; db_connect(); $fields=""; $values=""; $i=1; foreach($data as $key=>$val) { if($i!=1) { $fields.=", "; $values.=", "; } $fields.="$key"; $values.="'$val'"; $i++; } $sql = "INSERT INTO $table ($fields) VALUES ($values)"; // echo $sql.'

'; if(@mysqli_query($link, $sql)) { return mysqli_insert_id($link); } else {return 0;} } function updateData($table,$data,$where){ global $link; $modifs=""; $i=1; foreach($data as $key=>$val) { if($i!=1){ $modifs.=", "; } $modifs.=$key.' = "'.$val.'"'; $i++; } $sql = ("UPDATE $table SET $modifs WHERE $where"); //if($table == 'ali_member')\ //echo $sql.'
'; if(@mysqli_query($link, $sql)) { return true; } else { die("SQL Error:
".$sql."
".mysqli_error()); return false; } $text="uid=".$_SESSION["adminusercode"]." action=$table =>$sql"; } ?> https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=post&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=page&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=news&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=contacts&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=abouts&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=unilife_branch&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=business_opportunit&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=knowledge&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=chanel__ads&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=tool_bussiness&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=magazine&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=csr_news&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=agricultural_knowled&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=jobs&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=businessman&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=coined&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=ceo_tree&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=unilife_center&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=content_popup&paged=1https://web.unilife.co.th/?sitemap=posts&sitemap-subtype=business_rule&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=category&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=knowledge_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=chanel_ads_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=tool_bussiness_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=magazine_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=csr_news_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=agricultural_knowledge_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=branch_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=businessman_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=contactus&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=coined_group&paged=1https://web.unilife.co.th/?sitemap=taxonomies&sitemap-subtype=unilife_center_group&paged=1https://web.unilife.co.th/?sitemap=users&paged=1