함수마다 실제로 다른 함수 매개 변수로 함수를 루프하려고합니다.PHP isset 인 경우 자체 함수를 호출하여 사용자 함수를 호출하십시오.
Im 양식에서 제출 한 변수 매개 변수로 $login_name
을 사용합니다. 그래서이 매개 변수를 함수 자체로 변경하고 싶습니다. 불합리한? 어떤 대안이 있습니까?
여기 어디에 문제가 제 기능
$login_name = "U00001";
while (!isset($end)) {
function getcount($login_name) {
$get_node = mysql_query("SELECT * FROM b_userbase WHERE login_name='$login_name'");
while ($row_node = mysql_fetch_array($get_node)) {
$node = $row_node["user_node"];
$placement = $row_node["user_placement"];
}
$current_count = mysql_query("SELECT * FROM f_user_matching WHERE u_m_mem='$placement'");
while ($get_count = mysql_fetch_array($current_count)) {
$get_left_current = $get_count["u_m_left_current"];
$get_left_total = $get_count["u_m_left_total"];
$get_right_current = $get_count["u_m_right_current"];
$get_right_total = $get_count["u_m_right_total"];
$update_left_current = $get_left_current + 1;
$update_right_current = $get_right_current + 1;
$update_left_total = $get_left_total + 1;
$update_right_total = $get_right_total + 1;
}
if ($node == "L") {
$increase_qry = mysql_query("UPDATE f_user_matching
SET u_m_left_current= '{$update_left_current}',
u_m_left_total ='{$update_left_total}'
WHERE u_m_mem ='{$placement}' ");
}
if ($node == "R") {
$increase_qry = mysql_query("UPDATE f_user_matching
SET u_m_right_current= '{$update_right_current}',
u_m_right_total ='{$update_right_total}'
WHERE u_m_mem ='{$placement}' ");
}
$login_name = $placement;
if ($login_name == "IM000001") {
$end = 1;
} else {
$login_name = $placement;
}
global $login_name;
}
$count = getcount($login_name);
}
입니까?
[샘플 코드] (http://sscce.org/)는 완전하고 간결해야하며 문제를 설명하고 자체적으로 서술 할 수있을만큼 충분해야합니다. 관계없는 코드는 혼란 스럽습니다. 이전의 mysql 확장은 구식이며 지원이 중단 될 예정입니다. 새로운 코드는 PDO 나 mysqli 확장을 사용해야하며 둘 다 준비된 문장을 지원한다. 준비된 문 매개 변수는 주입에 취약하지 않습니다. 준비된 문 자체는 반복적 인 쿼리를 사용하는 경우 더 효과적입니다. 문을 한 번만 구문 분석하면되기 때문입니다. – outis