แก้โค้ด สถานะ ค่ะ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา แก้โค้ด สถานะ ค่ะ

แก้โค้ด สถานะ ค่ะ
อยากให้ตรงสถานะ แสดงแค่คนที่ออกจากจากสมาชิก ต้องเขียนยังไง ค่ะ

<?php require_once('../Connections/connection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_mem = "-1";
if (isset($_POST['word'])) {
  $colname_mem = $_POST['word'];
}
mysql_select_db($database_connection, $connection);
$query_mem = sprintf("SELECT * FROM members WHERE Member_date LIKE %s", GetSQLValueString("%" . $colname_mem . "%", "date"));
$mem = mysql_query($query_mem, $connection) or die(mysql_error());
$row_mem = mysql_fetch_assoc($mem);
$totalRows_mem = mysql_num_rows($mem);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ศูนย์ข้าวชุมชนตำบลโพกรวม</title>
<style type="text/css">
a:link {
	color: #000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000;
}
a:hover {
	text-decoration: none;
	color: #F00;
}
a:active {
	text-decoration: none;
	color: #F00;
}
</style>
</head>
<body bgcolor="#E0FFFF">
<center><img src="../img/111.jpg" height="250" width="1024">
<br /><br />
<form id="form1" name="form1" method="post" action="report_member.php">
  <h2>รายงานข้อมูลสมาชิกทั้งหมด  </h2><br>
    <label for="word">ค้นหา : </label>
    <input type="text" name="word" id="word" value="2015-11-1" />
    <input type="submit" name="button" id="button" value="ค้นหา" />
    <br><br />
 <table width="970" border="0" align="center">
  <tr>
    <td align="right"> <a href="report.php"> กลับหน้ารายงาน </a> / <a href="admin_page.php">กลับเมนูหลัก</a> <img src="../img/gif21.gif" /></td>
  </tr>
</table>
  <table border="1" width="1000">
    <tr align="center" bgcolor="#CDB7B5">
      <td>รหัสประจำตัวประชาชน</td>
      <td>ชื่อ - นามสกุล</td>
      <td>ที่อยู่</td>
      <td>อายุ</td>
      <td>เพศ</td>
      <td>สถานะสมาชิก</td>
      <td>วัน เดือน ปี </td>
    </tr>
    <?php do { ?>
      <tr align="center" bgcolor="#EEDFCC">
        <td><?php echo $row_mem['Members_id']; ?></td>
        <td><?php echo $row_mem['Members_name']; ?></td>
        <td><?php echo $row_mem['Members_address']; ?></td>
        <td><?php echo $row_mem['Members_age']; ?></td>
        <td><?php echo $row_mem['Members_sex']; ?></td>
        <td><?php echo $row_mem['Members_status']; ?></td>
        <td><?php echo date("d-m-Y",strtotime($row_mem['Member_date'])); ?></td>
      </tr>
      <?php } while ($row_mem = mysql_fetch_assoc($mem)); ?>
</table>
</form>
</center>
</body>
</html>
<?php
mysql_free_result($mem);
?>


Monchusa 125.26.115.xxx 07-12-2015 20:50:06

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
ใช้ if ellse เช็คให้แสดงเฉพาะถ้าไม่มี session ของสมาชิก  
 
if(!isset($_SESSION['xxxx']) || $_SESSION['xxxx']==""){

}


ninenik 122.155.43.xxx 07-12-2015
 ความคิดเห็นที่ 2
พิมถูกมั๊ยค่ะ แร้วต้องเอาไปปทรกตรงไหนอะค่ะ


if(!isset($_SESSION['Members_status']) || $_SESSION['Members_status']=="ออกจากสมาชิก"){

}


monchusa 125.26.114.xxx 08-12-2015 21:34
 ความคิดเห็นที่ 3
 ประมาณนี้หรือเปล่าว

<?php
if(!isset($_SESSION['Members_status']) || $_SESSION['Members_status']=="ออกจากสมาชิก"){  
     echo $row_mem['Members_status']; 
 } 
?>




ninenik 180.183.45.xxx 09-12-2015
 ความคิดเห็นที่ 4
ได้แร้วค่ะ เขียนแบบนี้เรย ขอบคุณมากเรยนะ ค่ะ 
<?php if(!isset($row_mem['Members_status']) || $row_mem['Members_status']=="ออกจากสมาชิก"){  
     echo $row_mem['Members_status']; 
 } ?>


monchusa 125.26.122.xxx 09-12-2015 23:21
1






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ