예제 #1
0
function selecting($select_member_id)
{
    $query = "SELECT * FROM membership WHERE member_id='" . strval($select_member_id) . "'";
    $result = SQL_CON($query);
    $user = mysql_fetch_array($result);
    return $user;
}
예제 #2
0
function getMemberCount()
{
    // member데이블 레코드 갯수 확인
    $sql = " SELECT count(*) FROM membership; ";
    $result = SQL_CON($sql);
    $count = mysql_result($result, 0, 0);
    return $count;
}
예제 #3
0
function getProductCount($pcategory)
{
    // product 레코드 테이블 수
    $sql = " SELECT count(*) FROM product WHERE pcategory LIKE '" . strval($pcategory) . "%'";
    $result = SQL_CON($sql);
    $count = mysql_result($result, 0, 0);
    return $count;
}
예제 #4
0
function updateProductByNum($data)
{
    $sql = " UPDATE product SET ";
    $sql .= " pcategory = '" . strval($data['pcategory']) . "'," . "pcode = '" . strval($data['pcode']) . "',pname = '" . strval($data['pname']) . "',pstock = '" . strval($data['pstock']) . "',pprice = '" . strval($data['pprice']) . "',pfimage = '" . strval($data['pfimage']) . "',psimage = '" . strval($data['psimage']) . "'";
    $sql .= " WHERE pnum = " . strval($data['pnum']);
    $result = SQL_CON($sql);
    return $result;
}
예제 #5
0
function logining($login_id, $login_passwd)
{
    $query = "SELECT * FROM membership WHERE id = '" . strval($id) . "' AND password = '******'";
    $result = SQL_CON($query);
    $user = mysql_fetch_array($result);
    if ($user['id'] && $user['id'] == $login_id && $user['passwd'] == $login_passwd) {
        return $user['level'];
    }
}
예제 #6
0
function selecting($select_member_id)
{
    $_SESSION['search'] = isset($_REQUEST['search']) ? $_REQUEST['search'] : null;
    $query = "SELECT * FROM membership WHERE member_id='" . strval($select_member_id) . "'";
    $result = SQL_CON($query);
    $user = mysql_fetch_array($result);
    mysql_close();
    return $user;
}
예제 #7
0
function product_selecting($pcategory, $product_info)
{
    $query = "select * from product where pcategory like '" . strval($pcategory) . "%' limit " . strval($product_info['currentpage_start_gesimul_num']) . "," . strval($product_info['CLPP']);
    $result = SQL_CON($query);
    $cnt = 0;
    while ($row = mysql_fetch_array($result)) {
        $productlist[$cnt]['pnum'] = $row['pnum'];
        $productlist[$cnt]['pcategory'] = $row['pcategory'];
        $productlist[$cnt]['pcode'] = $row['pcode'];
        $productlist[$cnt]['pname'] = $row['pname'];
        $productlist[$cnt]['pprice'] = $row['pprice'];
        $productlist[$cnt]['pstock'] = $row['pstock'];
        $productlist[$cnt]['pfimage'] = $row['pfimage'];
        $productlist[$cnt]['psimage'] = $row['psimage'];
        $cnt++;
    }
    return $productlist;
}
function selectAttachFile($ptnum)
{
    $query = "SELECT * FROM free_attach WHERE ptnum=" . strval($ptnum);
    $result = SQL_CON($query);
    if ($result) {
        $cnt = 0;
        while ($row = mysql_fetch_array($result)) {
            $AttachFile[$cnt] = $row;
            $cnt++;
        }
    } else {
        //첨부파일이 없을시 null값 입력
        $AttachFile = null;
    }
    return $AttachFile;
}