'; echo '$otb_name '.$otb_name.'
'; echo '$moDB '.$moDB.'
'; echo '$motb_name '.$motb_name.'
'; echo '$cases '.$cases.'
'; */ $localhost_s = $_GET["h"]; $localhost_u = $_GET["u"]; $localhost_p = $_GET["p"]; //echo 'localhost_p : '.$localhost_p; $ln_reg = mysql_connect($localhost_s, $localhost_u, $localhost_p, true); if (!$ln_reg) { echo " "; die(' Could not connect: ' . mysql_error()."$localhost_s, $localhost_u, $localhost_p"); echo ""; }else{ //echo "Connected $source_s successfully
"; } $db_reg = mysql_select_db($oDB, $ln_reg); mysql_query("SET NAMES UTF8", $ln_reg); mysql_query("SET character_set_results=utf8", $ln_reg); mysql_query("SET character_set_client=utf8", $ln_reg); if (!$db_reg) { die ("Can\'t use $oDB : " . mysql_error()); }else{ //echo "เชื่องต่อ $oDB สำเร็จ
"; } $query = getQryPbriChkData($oDB,$otb_name,$moDB,$motb_name,$cases); if($query!=''){ $result = mysql_query($query, $ln_reg); $num_case1 = mysql_num_rows($result); }else{ $num_case1 = 0; } $header_case = array('1' =>' ข้อมูลพื้นฐานของสบช.ที่วิทยาลัยยังไม่อัพเดต ', '2' => ' ข้อมูลระบบทะเบียนที่มีมากกว่าข้อมูลพื้นฐานของสบช. ', '3' => ' ข้อมูลที่PKตรงกันแต่ข้อมูลภายในไม่เท่ากัน '); ?> 0 && $cases!=1){ if($cases==1){ $comment = "ข้อมูลที่วิทยาลัยยังไม่ปรับปรุงได้จัดเก็บลงในฐานข้อมูลใหม่แล้ว"; }elseif($cases==2){ $comment = "เพิ่มข้อมูลทั้งหมดที่วิทยาลัยมีมากกว่าข้อมูลพื้นฐานลงในฐานข้อมูลใหม่"; $wh = substr($select,0,strpos($select, 'FROM')); $from = substr($query,strpos($query, 'FROM')); }elseif($cases==3){ $comment = "ปรับปรุงฐานข้อมูลใหม่ โดยใช้ข้อมูลของวิทยาลัย"; $strpos_inner = strpos($query, 'INNER'); $strpos_where = strpos($query, 'WHERE'); $inner = substr($query,$strpos_inner,$strpos_where-$strpos_inner); $where = substr($query,$strpos_where); } ?>
รายละเอียด $header_case[$cases]
"; echo "ตาราง $oDB.$otb_name เทียบตาราง $moDB.$motb_name
"; echo "ข้อมูลที่แตกต่างทั้งหมด $num_case1 แถว

"; ?>
ให้นำสคริปไป execute ทาง phpMyAdmin
> >
Query :
$select
$where"; }elseif($cases==3){ echo "$update
$set
$where ;"; } ?>
 
Query :
$wh
$from"; }elseif($cases==3){ echo "$update
$inner
$set_cmp
$where;"; } ?>