Áߺ¹µ¥ÀÌÅÍ Ãâ·Â¼Ò½º
<?
//ÆäÀÌÁö ÀÎŬ·çµå
include "../system_files/system_option.php";
include "../system_files/system_common2.php";
//db ¿¬°á
$db_name = "imsi";
$db_user = "temp";
$db = new DataBase(); //db °´Ã¼¸¦ »ý¼ºÇÑ´Ù.
$db->conn($db_name, $db_user, $db_user_pw, $db_host);
//¸®½ºÆà Äõ¸®
$offset = ($pNum * $list_size) - $list_size;
$q = "select m_hphone, count(m_hphone) from member_eqsms group by m_hphone having count(m_hphone) > 1";
$rs = new RecordSet();
$rs->open($q, $db);
$dup_hphones = array();
print "//Áߺ¹µÈ ÇÚµåÆù ¹øÈ£<br>";
$i = 0;
while($rs->next()){
printf("ÇÚµåÆù: %s, Áߺ¹È¸¼ö: %s<br>", $rs->get_str(0), $rs->get_str(1));
$dup_hphones[$i] = $rs->get_str(0);
$i++;
}
$rs->close();
print "ÇÕ°è: $i";
print "<p>//Áߺ¹µÈ ÇÚµåÆù ¹øÈ£¸¦ »ç¿ëÇÏ´Â ID<br>";
$k = 0;
for($i = 0; $i < count($dup_hphones); $i++){
print "---------------------<br>";
$q = "select m_id, m_hphone, m_eq_money from member_eqsms where m_hphone = '$dup_hphones[$i]'";
$rs = new RecordSet();
$rs->open($q, $db);
while($rs->next()){
printf("ID: %s, ÇÚµåÆù: %s, EQM: %s<br>"
, $rs->get_str(0), $rs->get_str(1), $rs->get_str(2));
$k++;
}
$rs->close();
}
print "ÇÕ°è: $k";
$db->close();
?> | |